/* ============================================
   LEDPRO DSG ERP - Proflow/Nexus Dark Dashboard
   GitHub-Dark Inspired Color System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Core palette - GitHub Dark */
  --bg-body: #000000;
  --bg-canvas: #000000;
  --bg-surface: rgba(30, 35, 45, 0.6);
  --bg-elevated: rgba(30, 35, 45, 0.8);
  --bg-card: rgba(30, 35, 45, 0.6);
  --bg-card-hover: rgba(35, 40, 50, 0.7);
  --bg-input: rgba(10, 12, 18, 0.95);
  --bg-input-focus: rgba(0,102,255,0.06);

  /* Borders */
  --border-default: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.06);
  --border-muted: rgba(255,255,255,0.1);
  --border-focus: #0066ff;

  /* Accent colors */
  --accent-blue: #0066ff;
  --accent-blue-dark: #0055dd;
  --accent-blue-glow: rgba(0,102,255,0.3);
  --accent-blue-bg: rgba(0,102,255,0.08);
  --accent-blue-bg-strong: rgba(0,102,255,0.15);

  /* Text */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --text-link: #0066ff;
  --text-white: #ffffff;

  /* Status colors */
  --green: #3fb950;
  --green-dark: #238636;
  --green-bg: rgba(63,185,80,0.1);
  --green-border: rgba(63,185,80,0.3);

  --orange: #d29922;
  --orange-dark: #9e6a03;
  --orange-bg: rgba(210,153,34,0.1);
  --orange-border: rgba(210,153,34,0.3);

  --red: #f85149;
  --red-dark: #da3633;
  --red-bg: rgba(248,81,73,0.1);
  --red-border: rgba(248,81,73,0.3);

  --purple: #bc8cff;
  --purple-dark: #8957e5;
  --purple-bg: rgba(188,140,255,0.1);
  --purple-border: rgba(188,140,255,0.3);

  --cyan: #39d353;
  --cyan-alt: #2ea043;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 68px;
  --sidebar-bg: rgba(10, 12, 18, 0.95);

  /* Top bar */
  --topbar-height: 60px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  /* Z-index layers */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-modal-backdrop: 200;
  --z-modal: 210;
  --z-toast: 300;
  --z-tooltip: 400;
}


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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

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

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

::selection {
  background: var(--accent-blue-dark);
  color: #fff;
}


/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}


/* --- Layout Shell --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.main-content {
  flex: 1;
  padding: 24px 28px;
  margin-top: var(--topbar-height);
  max-width: 1600px;
  width: 100%;
}


/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--transition-base);
  overflow: hidden;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

/* Logo area */
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition-base);
}

.sidebar-logo-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.sidebar-logo-text span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
}

/* Upload logo button */
.upload-logo-btn {
  margin: 10px 12px;
  padding: 7px;
  background: transparent;
  border: 1px dashed var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.upload-logo-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

.sidebar-collapsed .upload-logo-btn {
  display: none;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapsed .nav-section-label {
  opacity: 0;
  height: 10px;
  padding: 4px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  margin-bottom: 1px;
}

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

.nav-item.active {
  background: var(--accent-blue-bg-strong);
  color: var(--accent-blue);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* Per-icon color theming */
.nav-item[data-section="dashboard"] .nav-item-icon { filter: hue-rotate(0deg); color: var(--accent-blue); }
.nav-item[data-section="pipeline"] .nav-item-icon { color: var(--purple); }
.nav-item[data-section="clientes"] .nav-item-icon { color: var(--accent-blue); }
.nav-item[data-section="pedidos"] .nav-item-icon { color: var(--orange); }
.nav-item[data-section="cotizador"] .nav-item-icon { color: var(--green); }
.nav-item[data-section="stock"] .nav-item-icon { color: var(--cyan); }
.nav-item[data-section="finanzas"] .nav-item-icon { color: #3fb950; }
.nav-item[data-section="alertas"] .nav-item-icon { color: var(--orange); }
.nav-item[data-section="conversaciones"] .nav-item-icon { color: var(--accent-blue); }
.nav-item[data-section="equipo"] .nav-item-icon { color: var(--purple); }
.nav-item[data-section="configuracion"] .nav-item-icon { color: var(--text-secondary); }

.nav-item.active .nav-item-icon {
  color: var(--accent-blue);
}

.nav-item-label {
  transition: opacity var(--transition-base);
  font-size: 13px;
}

.sidebar-collapsed .nav-item-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--red-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-collapsed .nav-item-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  font-size: 8px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--bg-surface);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--green-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-collapsed .sidebar-user-info {
  display: none;
}

/* Sidebar toggle */
.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -13px;
  width: 26px;
  height: 26px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  transition: all var(--transition-fast);
  z-index: 10;
}

.sidebar-toggle:hover {
  background: var(--accent-blue-dark);
  color: #fff;
  border-color: var(--accent-blue-dark);
}


/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: var(--z-topbar);
  transition: left var(--transition-base);
}

.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed-width);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search */
.topbar-search {
  position: relative;
}

.topbar-search input {
  width: 260px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 14px 0 36px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--transition-fast);
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
  width: 320px;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Notification bell */
.topbar-notification {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
  color: var(--text-secondary);
}

.topbar-notification:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.topbar-notification .notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--red-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-body);
}

/* User avatar */
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--green-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}


/* ============================================
   CARDS (Flat, no glassmorphism)
   ============================================ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

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

.glass-card-flat {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}


/* ============================================
   KPI CARDS
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: default;
}

.kpi-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.kpi-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-card-icon.blue { background: rgba(0,102,255,0.12); color: var(--accent-blue); }
.kpi-card-icon.green { background: var(--green-bg); color: var(--green); }
.kpi-card-icon.yellow { background: var(--orange-bg); color: var(--orange); }
.kpi-card-icon.red { background: var(--red-bg); color: var(--red); }
.kpi-card-icon.cyan { background: rgba(57,211,83,0.1); color: var(--cyan); }

.kpi-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-card-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-card-change.positive { color: var(--green); }
.kpi-card-change.negative { color: var(--red); }
.kpi-card-change.neutral { color: var(--text-muted); }


/* ============================================
   CHARTS
   ============================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-actions {
  display: flex;
  gap: 4px;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}


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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: transparent;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

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

.data-table .cell-name {
  color: var(--text-primary);
  font-weight: 500;
}

.data-table .cell-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Expandable row */
.data-table .expand-row {
  cursor: pointer;
}

.data-table .expand-row td:first-child::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.data-table .expand-row.expanded td:first-child::before {
  transform: rotate(90deg);
}

.data-table .expanded-content {
  display: none;
}

.data-table .expanded-content.show {
  display: table-row;
}

.data-table .expanded-content td {
  padding: 20px 24px;
  background: rgba(22,27,34,0.5);
  border-bottom: 1px solid var(--border-default);
}


/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
}

.kanban-column {
  min-width: 260px;
  max-width: 290px;
  flex-shrink: 0;
  background: transparent;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-count {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.kanban-column-body {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.kanban-card:hover {
  border-color: var(--border-muted);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kanban-card:active {
  cursor: grabbing;
}

/* Priority-based left border */
.kanban-card:has(.badge-red) {
  border-left-color: var(--red);
}
.kanban-card:has(.badge-yellow) {
  border-left-color: var(--orange);
}
.kanban-card:has(.badge-blue) {
  border-left-color: var(--accent-blue);
}
.kanban-card:has(.badge-green) {
  border-left-color: var(--green);
}
.kanban-card:has(.badge-cyan) {
  border-left-color: var(--cyan);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kanban-card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

.kanban-add-btn {
  padding: 8px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
  margin: 0 10px 10px;
}

.kanban-add-btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: var(--accent-blue-bg);
}


/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent-blue-dark);
  color: #fff;
}

.btn-primary:hover {
  background: #388bfd;
  box-shadow: 0 2px 8px rgba(31,111,235,0.3);
}

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

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

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

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

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

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

.btn-success {
  background: var(--green-dark);
  color: #fff;
}

.btn-success:hover {
  background: #2ea043;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--green-dark), #2ea043);
  color: #fff;
}

.btn-gradient:hover {
  box-shadow: 0 4px 16px rgba(35,134,54,0.4);
  transform: translateY(-1px);
}


/* ============================================
   BADGES / TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue {
  background: rgba(31,111,235,0.2);
  color: var(--accent-blue);
}

.badge-green {
  background: rgba(35,134,54,0.2);
  color: var(--green);
}

.badge-yellow {
  background: rgba(158,106,3,0.2);
  color: var(--orange);
}

.badge-red {
  background: rgba(218,54,51,0.2);
  color: var(--red);
}

.badge-cyan {
  background: rgba(57,211,83,0.15);
  color: var(--cyan);
}

.badge-gray {
  background: rgba(72,79,88,0.2);
  color: var(--text-secondary);
}

.badge-purple {
  background: rgba(137,87,229,0.2);
  color: var(--purple);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.badge-dot.green { background: var(--green); }
.badge-dot.yellow { background: var(--orange); }
.badge-dot.red { background: var(--red); }
.badge-dot.blue { background: var(--accent-blue); }


/* ============================================
   FORM INPUTS
   ============================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

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

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

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

.form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: var(--radius-full);
  transition: transform var(--transition-base);
}

.toggle input:checked + .toggle-slider {
  background: var(--green-dark);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}


/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-default);
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  margin-bottom: -1px;
}

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

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-content {
  display: none;
  animation: fadeInSection 0.3s ease;
}

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


/* ============================================
   ALERT CARDS
   ============================================ */
.alert-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.alert-card:hover {
  background: var(--bg-card-hover);
}

.alert-card.critical {
  border-left-color: var(--red);
  background: var(--red-bg);
}

.alert-card.urgent {
  border-left-color: var(--orange);
  background: var(--orange-bg);
}

.alert-card.info {
  border-left-color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

.alert-card.success {
  border-left-color: var(--green);
  background: var(--green-bg);
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-body {
  flex: 1;
}

.alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.alert-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.alert-time {
  font-size: 11px;
  color: var(--text-muted);
}

.alert-dismiss {
  padding: 4px 10px;
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  align-self: center;
}

.alert-dismiss:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-muted);
}


/* ============================================
   CONVERSATION / CHAT FEED
   ============================================ */
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-item:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.chat-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chat-item-body {
  flex: 1;
  min-width: 0;
}

.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.chat-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-item-message {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  align-self: center;
}

.chat-item-status.online { background: var(--green); }
.chat-item-status.offline { background: var(--text-muted); }
.chat-item-status.busy { background: var(--orange); }

/* Full conversation view */
.conversation-panel {
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.msg-bubble.incoming {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-self: flex-start;
  border-radius: 18px 18px 18px 4px;
}

.msg-bubble.outgoing {
  background: var(--accent-blue-dark);
  color: #fff;
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}


/* ============================================
   MODAL / SLIDE-IN PANEL
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  z-index: var(--z-modal);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active + .modal,
.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid var(--border-default);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

/* Slide-in panel (right) */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 450px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-body);
  border-left: 1px solid var(--border-default);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  padding: 28px;
}

.slide-panel.active {
  transform: translateX(0);
}

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}


/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-muted);
  border-top-color: var(--accent-blue);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

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

/* Loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,17,23,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 5;
}


/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  border-left: 3px solid var(--accent-blue);
}

.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--orange); }
.toast.error { border-left-color: var(--red); }

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

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

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}


/* ============================================
   TOOLTIPS
   ============================================ */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}

.tooltip-wrap .tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
  z-index: var(--z-tooltip);
}

.tooltip-wrap .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-default);
}

.tooltip-wrap:hover .tooltip-text {
  opacity: 1;
  visibility: visible;
}


/* ============================================
   SECTION ANIMATIONS
   ============================================ */
.section {
  display: none;
  animation: fadeInSection 0.3s ease;
}

.section.active {
  display: block;
}

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

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

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

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

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

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

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideInUp 0.3s ease; }
.animate-slide-right { animation: slideInRight 0.3s ease; }
.animate-scale { animation: scaleIn 0.25s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }


/* ============================================
   TEAM MEMBER CARDS
   ============================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--transition-base);
}

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

.team-card-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 14px;
  position: relative;
}

.team-card-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-body);
}

.team-card-status-dot.online { background: var(--green); }
.team-card-status-dot.offline { background: var(--text-muted); }

.team-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.team-card-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.team-card-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.team-card-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.team-card-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}


/* ============================================
   STOCK / MATERIAL CARDS
   ============================================ */
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.stock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition-base);
}

.stock-card:hover {
  border-color: var(--border-muted);
}

.stock-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stock-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.stock-bar-wrap {
  background: var(--border-default);
  border-radius: var(--radius-full);
  height: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.stock-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.stock-bar.good { background: var(--green); }
.stock-bar.low { background: var(--orange); }
.stock-bar.critical { background: var(--red); }

.stock-card-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}


/* ============================================
   COTIZADOR / QUOTE BUILDER
   ============================================ */
.cotizador-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.price-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
}

.price-total {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
}

.price-line-label {
  color: var(--text-secondary);
}

.price-line-value {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price-line.discount .price-line-value {
  color: var(--green);
}

.price-line.total {
  border-bottom: none;
  border-top: 2px solid var(--border-muted);
  padding-top: 12px;
  margin-top: 4px;
}

.price-line.total .price-line-label {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.price-line.total .price-line-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-blue);
}


/* ============================================
   PIPELINE MINI SUMMARY
   ============================================ */
.pipeline-bar {
  display: flex;
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 26px;
  background: var(--border-default);
}

.pipeline-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  transition: flex var(--transition-slow);
  position: relative;
}

.pipeline-bar-segment:hover {
  filter: brightness(1.15);
}

.pipeline-bar-segment.s1 { background: #8957e5; }
.pipeline-bar-segment.s2 { background: #1f6feb; }
.pipeline-bar-segment.s3 { background: #2ea043; }
.pipeline-bar-segment.s4 { background: #3fb950; }
.pipeline-bar-segment.s5 { background: #d29922; }
.pipeline-bar-segment.s6 { background: #da3633; }

.pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.pipeline-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pipeline-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}


/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-actions {
  display: flex;
  gap: 8px;
}


/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.filter-btn.active {
  background: var(--accent-blue-bg-strong);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}


/* ============================================
   FINANCE / TRANSACTIONS
   ============================================ */
.transaction-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
  gap: 12px;
}

.transaction-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.transaction-icon.income {
  background: var(--green-bg);
  color: var(--green);
}

.transaction-icon.expense {
  background: var(--red-bg);
  color: var(--red);
}

.transaction-info {
  flex: 1;
}

.transaction-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.transaction-date {
  font-size: 11px;
  color: var(--text-muted);
}

.transaction-amount {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.transaction-amount.positive { color: var(--green); }
.transaction-amount.negative { color: var(--red); }


/* ============================================
   SETTINGS SECTION
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--accent-blue-bg-strong);
  color: var(--accent-blue);
  font-weight: 500;
}

.settings-content {
  min-height: 400px;
}

.settings-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
}

.settings-row-label {
  font-size: 13px;
  color: var(--text-primary);
}

.settings-row-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}


/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}


/* ============================================
   STATUS TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--accent-blue);
  border: 3px solid var(--bg-body);
}

.timeline-item.completed::before {
  background: var(--green);
}

.timeline-item.pending::before {
  background: var(--text-muted);
}

.timeline-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}


/* ============================================
   CALCULATOR / PRINT CALCULATOR
   ============================================ */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 20px;
}

.calculator-canvas {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  min-height: 400px;
}

.calculator-canvas-grid {
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(57,211,83,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57,211,83,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid rgba(57,211,83,0.2);
  border-radius: var(--radius-md);
}

.calculator-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.circular-progress {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: conic-gradient(var(--green) var(--progress, 75%), var(--border-default) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.circular-progress-inner {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}


/* ============================================
   WIKI SECTION
   ============================================ */
.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.wiki-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
}

.wiki-card:hover {
  border-color: var(--border-muted);
  transform: translateY(-2px);
}

.wiki-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.wiki-card-icon.blue { background: rgba(31,111,235,0.12); }
.wiki-card-icon.green { background: var(--green-bg); }
.wiki-card-icon.orange { background: var(--orange-bg); }
.wiki-card-icon.purple { background: var(--purple-bg); }

.wiki-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wiki-card-count {
  font-size: 12px;
  color: var(--text-muted);
}


/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-blue); }
.text-success { color: var(--green); }
.text-warning { color: var(--orange); }
.text-error { color: var(--red); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}


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

/* Tablet */
@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .cotizador-layout {
    grid-template-columns: 1fr;
  }

  .price-preview {
    position: static;
  }

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

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

/* Small tablet / large phone - sidebar collapse */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .topbar {
    left: 0 !important;
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
  }

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

  .kanban-board {
    overflow-x: auto;
  }

  .kanban-column {
    min-width: 240px;
  }

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

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .topbar-search input {
    width: 160px;
  }

  .topbar-search input:focus {
    width: 200px;
  }
}

/* Phone */
@media (max-width: 600px) {
  html {
    font-size: 13px;
  }

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

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

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

  .topbar-search {
    display: none;
  }

  .slide-panel {
    width: 100%;
  }

  .modal {
    width: 95%;
    padding: 20px;
  }

  .topbar-title {
    font-size: 16px;
  }

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

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-toggle {
    display: none;
  }
}


/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar,
  .topbar,
  .toast-container {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .main-content {
    margin-top: 0;
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
  }

  .glass-card,
  .glass-card-flat,
  .kpi-card,
  .chart-container,
  .stock-card,
  .team-card {
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: none;
  }
}
