/* ==============================================================================
   ARCHI-FLOW LITE: SISTEMA DE DISEÑO DE MATERIALES NATURALES Y ARQUITECTURA
   Paleta: Hormigón, Travertino, Arcilla / Terracota, Madera de Roble, Lino, Basalto y Pizarra
   ============================================================================== */

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

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme: Travertino & Piedra Caliza (Modo Claro Cálido) */
  --bg-primary: #f8f7f2;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f2efe9;
  --bg-hover: #e7e2d8;
  
  --text-primary: #2c2724;
  --text-secondary: #5c554e;
  --text-muted: #8c837a;
  
  --border-subtle: #e5e0d5;
  --border-default: #d3cbbe;
  --border-focus: #c2410c;

  /* Colores Naturales de Materiales - Prioridades */
  /* Urgente: Arcilla Cocida / Terracota / Ladrillo */
  --priority-urgent: #c2410c;
  --priority-urgent-bg: #fff7ed;
  --priority-urgent-border: #fdba74;
  --priority-urgent-text: #9a3412;

  /* Importante: Ocre Tostado / Madera de Roble */
  --priority-important: #b45309;
  --priority-important-bg: #fefce8;
  --priority-important-border: #fde047;
  --priority-important-text: #854d0e;

  /* Normal: Salvia / Piedra Pizarra / Lino */
  --priority-normal: #475569;
  --priority-normal-bg: #f1f5f9;
  --priority-normal-border: #cbd5e1;
  --priority-normal-text: #334155;

  /* Estados Naturales */
  --status-pending: #78716c;
  --status-pending-bg: #f5f5f4;
  --status-in-progress: #b45309;
  --status-in-progress-bg: #fffbeb;
  --status-blocked: #991b1b;
  --status-blocked-bg: #fef2f2;
  --status-completed: #15803d;
  --status-completed-bg: #f0fdf4;

  --shadow-sm: 0 1px 3px rgba(44, 39, 36, 0.06);
  --shadow-md: 0 4px 10px rgba(44, 39, 36, 0.08);
  --shadow-lg: 0 12px 20px rgba(44, 39, 36, 0.1);
  --shadow-xl: 0 20px 30px rgba(44, 39, 36, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Modo Oscuro: Basalto Volcánico, Grafito Cálido & Madera Carbonizada (Yakisugi) */
.dark-theme {
  --bg-primary: #151311;
  --bg-surface: #1d1a17;
  --bg-surface-elevated: #24201c;
  --bg-subtle: #2d2823;
  --bg-hover: #3b352e;
  
  --text-primary: #f5f2eb;
  --text-secondary: #d6cfc4;
  --text-muted: #948b7f;
  
  --border-subtle: #2d2823;
  --border-default: #443c35;
  --border-focus: #ea580c;

  /* Terracota Cálido Oscuro */
  --priority-urgent: #ea580c;
  --priority-urgent-bg: rgba(194, 65, 12, 0.18);
  --priority-urgent-border: rgba(234, 88, 12, 0.45);
  --priority-urgent-text: #fdba74;

  /* Ocre & Roble Tostado Oscuro */
  --priority-important: #d97706;
  --priority-important-bg: rgba(180, 83, 9, 0.18);
  --priority-important-border: rgba(217, 119, 6, 0.45);
  --priority-important-text: #fde047;

  /* Pizarra & Salvia Oscuro */
  --priority-normal: #94a3b8;
  --priority-normal-bg: rgba(71, 85, 105, 0.2);
  --priority-normal-border: rgba(148, 163, 184, 0.35);
  --priority-normal-text: #e2e8f0;

  --status-pending-bg: rgba(120, 113, 108, 0.2);
  --status-in-progress-bg: rgba(180, 83, 9, 0.2);
  --status-blocked-bg: rgba(153, 27, 27, 0.25);
  --status-completed-bg: rgba(21, 128, 61, 0.2);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 12px 20px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Custom Scrollbars estilo Piedra */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 9999px;
}

/* Header Estudio */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7c2d12, #c2410c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-lite {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #ffedd5;
  color: #9a3412;
  letter-spacing: 0.05em;
  border: 1px solid #fed7aa;
}
.dark-theme .badge-lite {
  background: rgba(194, 65, 12, 0.25);
  color: #fdba74;
  border-color: rgba(234, 88, 12, 0.45);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #16a34a;
  display: inline-block;
  box-shadow: 0 0 8px #16a34a;
}

/* View Switcher */
.view-switcher {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.shortcut-key {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-md);
  background: #c2410c;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.25);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

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

/* Active User Profile Widget */
.active-user-container {
  position: relative;
}

.active-user-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.active-user-btn:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-default);
}

.user-avatar-badge {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.user-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.user-role-pill {
  font-size: 0.6rem;
  font-weight: 700;
  color: #c2410c;
}
.dark-theme .user-role-pill {
  color: #fdba74;
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 300px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.65rem;
  z-index: 50;
  animation: slideUp 0.15s ease-out;
}

.dropdown-header {
  padding: 0.5rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.dropdown-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-primary);
}

.dropdown-subtitle {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dropdown-user-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dropdown-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.dropdown-user-item:hover {
  background-color: var(--bg-hover);
}

.dropdown-user-item.active {
  border-color: #c2410c;
  background-color: var(--priority-urgent-bg);
}

.dropdown-footer {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-manage-project-teams {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.725rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-default);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-manage-project-teams:hover {
  background-color: var(--bg-hover);
  border-color: #c2410c;
  color: #c2410c;
}

/* User Space / Workspace Switcher Banner */
.workspace-scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.scope-toggle-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.scope-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-btn.active {
  background-color: var(--bg-surface);
  color: #c2410c;
  box-shadow: var(--shadow-sm);
}

/* Avatar Stack for multi-assigned team members */
.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar-initials {
  margin-left: -0.35rem;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.avatar-stack .avatar-initials:first-child {
  margin-left: 0;
}

/* Project Team Table */
.project-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.team-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* Obras / Projects View Grid & Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

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

.project-card-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.3;
  cursor: pointer;
}

.project-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.project-task-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0.85rem 0;
  background-color: var(--bg-subtle);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.breakdown-num {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-primary);
}

.breakdown-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  gap: 0.5rem;
}

/* Main Layout */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Stats HUD */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.stat-card.urgent-highlight {
  border-color: var(--priority-urgent-border);
  background: var(--priority-urgent-bg);
}

.stat-card.overdue-highlight {
  border-color: rgba(194, 65, 12, 0.6);
  background: var(--priority-urgent-bg);
}

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

.stat-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.urgent-highlight .stat-title {
  color: var(--priority-urgent-text);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.stat-desc {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Quick Add Inline Bar */
.quick-add-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.quick-add-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-input-title {
  flex: 1;
  min-width: 260px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.quick-input-title:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
}

.quick-select {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.quick-date-input {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
}

/* Filter Bar */
.filter-bar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.filter-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input {
  width: 100%;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.member-filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.member-chip.active {
  background-color: #c2410c;
  color: #ffffff;
  border-color: #c2410c;
}

.avatar-initials {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: #ffffff;
}

.urgent-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--priority-urgent-border);
  background-color: var(--priority-urgent-bg);
  color: var(--priority-urgent-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.urgent-filter-btn.active {
  background-color: var(--priority-urgent);
  color: #ffffff;
  border-color: var(--priority-urgent);
  box-shadow: 0 0 12px rgba(194, 65, 12, 0.4);
}

.filter-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-subtle);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.filter-chip {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Kanban Board */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .kanban-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .kanban-grid {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.kanban-column.drag-over {
  border-color: var(--border-focus);
  background-color: var(--priority-urgent-bg);
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.25);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.column-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.column-count {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.column-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* Task Card */
.task-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: grab;
  position: relative;
}

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

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

/* Overdue & Urgency Alerts con Terracota y Arcilla */
.task-card.alert-urgent {
  border-color: var(--priority-urgent-border);
  box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.35);
}

.task-card.alert-overdue {
  border-color: #c2410c;
  box-shadow: 0 0 12px rgba(194, 65, 12, 0.25);
  animation: pulseAlert 2.5s infinite;
}

@keyframes pulseAlert {
  0%, 100% { border-color: rgba(194, 65, 12, 0.4); }
  50% { border-color: rgba(194, 65, 12, 0.9); }
}

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

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.card-title.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

.card-notes {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.675rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.due-badge.overdue {
  background-color: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
  animation: pulseText 1.5s infinite;
}
.dark-theme .due-badge.overdue {
  background-color: rgba(194, 65, 12, 0.25);
  color: #fdba74;
  border-color: rgba(234, 88, 12, 0.5);
}

.due-badge.today {
  background-color: #c2410c;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.4);
}

.due-badge.tomorrow {
  background-color: #fefce8;
  color: #854d0e;
  border-color: #fde047;
}
.dark-theme .due-badge.tomorrow {
  background-color: rgba(180, 83, 9, 0.25);
  color: #fde047;
  border-color: rgba(217, 119, 6, 0.45);
}

.due-badge.upcoming {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  transition: transform 0.1s ease;
}

.priority-badge:active {
  transform: scale(0.95);
}

.priority-urgent {
  background-color: var(--priority-urgent-bg);
  color: var(--priority-urgent-text);
  border-color: var(--priority-urgent-border);
}

.priority-important {
  background-color: var(--priority-important-bg);
  color: var(--priority-important-text);
  border-color: var(--priority-important-border);
}

.priority-normal {
  background-color: var(--priority-normal-bg);
  color: var(--priority-normal-text);
  border-color: var(--priority-normal-border);
}

.card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  margin-top: 0.35rem;
  border-top: 1px dashed var(--border-subtle);
}

.btn-move-next {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #c2410c;
  background: transparent;
  border: none;
  cursor: pointer;
}
.btn-move-next:hover {
  text-decoration: underline;
}

.btn-delete-card {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
}
.btn-delete-card:hover {
  color: #c2410c;
}

/* Spreadsheet Table View */
.table-wrapper {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.archi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.archi-table th {
  background-color: var(--bg-subtle);
  padding: 0.75rem 1rem;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.archi-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.archi-table tr:hover {
  background-color: var(--bg-subtle);
}

.archi-table tr.alert-row {
  background-color: var(--priority-urgent-bg);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(21, 19, 17, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.2);
}

.priority-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.priority-option-btn {
  padding: 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.priority-option-btn.selected-urgent {
  background-color: var(--priority-urgent);
  color: #ffffff;
  border-color: var(--priority-urgent);
  box-shadow: 0 4px 10px rgba(194, 65, 12, 0.3);
}

.priority-option-btn.selected-important {
  background-color: var(--priority-important);
  color: #ffffff;
  border-color: var(--priority-important);
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.3);
}

.priority-option-btn.selected-normal {
  background-color: #475569;
  color: #ffffff;
  border-color: #475569;
  box-shadow: 0 4px 10px rgba(71, 85, 105, 0.3);
}

.member-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.member-option-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.member-option-btn.selected {
  background-color: rgba(194, 65, 12, 0.12);
  border-color: #c2410c;
  box-shadow: 0 0 0 1px #c2410c;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Toast */
.toast-popup {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  background: #2c2724;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideUp 0.2s ease-out;
}
.dark-theme .toast-popup {
  background: #c2410c;
}

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

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

/* ==============================================================================
   LOGIN SCREEN & MICROSOFT ENTRA ID (SSO) PORTAL
   ============================================================================== */
.auth-login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(194, 65, 12, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(71, 85, 105, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.04) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 3rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .auth-card {
  background: #1c1917;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.auth-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.auth-logo-icon {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--radius-lg);
  background: #c2410c;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px -4px rgba(194, 65, 12, 0.4);
}

.auth-main-title {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

.auth-main-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.auth-main-action {
  width: 100%;
}

.btn-microsoft-sso {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem 1.75rem;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .btn-microsoft-sso {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-microsoft-sso:hover {
  background: #0284c7;
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.45);
}

.btn-microsoft-sso:active {
  transform: translateY(0);
}

.auth-footer-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* User Menu Dropdown Logout & Tenant info */
.dropdown-tenant-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.btn-logout-session {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout-session:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}


