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

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #111827;
  --sidebar-text: #cbd5e1;
  --brand: #0d9488;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --border: rgba(11, 11, 11, 0.1);

  /* Colores de estado — compartidos entre Dashboard (dona) y Kanban (columnas),
     independientes del color de marca. Las variantes -bg/-border son el mismo
     color en baja opacidad, para fondos/bordes suaves. */
  --status-nuevo: #1baf7a;
  --status-en_atencion: #2a78d6;
  --status-humano: #4a3aa7;
  --status-convertido: #008300;
  --status-descalificado: #e34948;
  --status-abandono: #eb6834;

  --status-nuevo-bg: rgba(27, 175, 122, 0.08);
  --status-en_atencion-bg: rgba(42, 120, 214, 0.08);
  --status-humano-bg: rgba(74, 58, 167, 0.08);
  --status-convertido-bg: rgba(0, 131, 0, 0.08);
  --status-descalificado-bg: rgba(227, 73, 72, 0.08);
  --status-abandono-bg: rgba(235, 104, 52, 0.08);

  --status-nuevo-border: rgba(27, 175, 122, 0.35);
  --status-en_atencion-border: rgba(42, 120, 214, 0.35);
  --status-humano-border: rgba(74, 58, 167, 0.35);
  --status-convertido-border: rgba(0, 131, 0, 0.35);
  --status-descalificado-border: rgba(227, 73, 72, 0.35);
  --status-abandono-border: rgba(235, 104, 52, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --border: rgba(255, 255, 255, 0.1);
    --brand: #14b8a9;

    --status-nuevo: #199e70;
    --status-en_atencion: #3987e5;
    --status-humano: #9085e9;
    --status-convertido: #008300;
    --status-descalificado: #e66767;
    --status-abandono: #d95926;

    --status-nuevo-bg: rgba(25, 158, 112, 0.12);
    --status-en_atencion-bg: rgba(57, 135, 229, 0.12);
    --status-humano-bg: rgba(144, 133, 233, 0.12);
    --status-convertido-bg: rgba(0, 131, 0, 0.14);
    --status-descalificado-bg: rgba(230, 103, 103, 0.12);
    --status-abandono-bg: rgba(217, 89, 38, 0.14);

    --status-nuevo-border: rgba(25, 158, 112, 0.4);
    --status-en_atencion-border: rgba(57, 135, 229, 0.4);
    --status-humano-border: rgba(144, 133, 233, 0.4);
    --status-convertido-border: rgba(0, 131, 0, 0.45);
    --status-descalificado-border: rgba(230, 103, 103, 0.4);
    --status-abandono-border: rgba(217, 89, 38, 0.45);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
}

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

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo span {
  color: var(--brand);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(13, 148, 136, 0.18);
  color: #fff;
  border-left-color: var(--brand);
}

.sidebar-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-label {
  white-space: nowrap;
}

.app-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.business-name {
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  background: var(--page-plane);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.header-icon-wrap {
  position: relative;
}

.header-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--page-plane);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

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

.header-icon-btn svg {
  width: 17px;
  height: 17px;
}

.header-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.header-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  background: var(--page-plane);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.header-dropdown[hidden] {
  display: none;
}

.header-dropdown-empty {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 4px;
  text-align: center;
}

.header-dropdown-business {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.header-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.header-dropdown-item:hover {
  background: rgba(13, 148, 136, 0.1);
  color: var(--brand);
}

.placeholder-page {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.placeholder-page h2 {
  color: var(--text-primary);
  font-size: 22px;
  margin-bottom: 8px;
}
