/* Core Design Tokens & System */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* HSL Colors */
  --bg-main: hsl(222, 47%, 9%);
  --bg-sidebar: hsl(223, 47%, 12%);
  --bg-card: hsla(223, 47%, 15%, 0.7);
  --border-color: hsla(223, 47%, 26%, 0.45);
  --border-focus: hsl(256, 100%, 70%);

  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 78%);
  --text-muted: hsl(215, 16%, 58%);

  /* Accents & States */
  --color-primary: hsl(256, 95%, 66%);
  --color-primary-glow: hsla(256, 95%, 66%, 0.3);
  --color-secondary: hsl(200, 95%, 55%);
  
  --color-blue: hsl(210, 100%, 55%);
  --color-purple: hsl(270, 95%, 65%);
  --color-green: hsl(145, 80%, 42%);
  --color-orange: hsl(35, 95%, 52%);
  --color-red: hsl(355, 85%, 58%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px var(--color-primary-glow);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Dynamic background mesh */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, hsla(256, 95%, 55%, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, hsla(200, 95%, 55%, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, hsla(220, 50%, 10%, 1) 0%, var(--bg-main) 100%);
  filter: blur(10px);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: hsla(223, 47%, 9%, 0.3);
}
::-webkit-scrollbar-thumb {
  background: hsla(223, 47%, 30%, 0.5);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(223, 47%, 45%, 0.7);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* Utilities */
.hidden {
  display: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  filter: brightness(1.1);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: hsla(223, 47%, 20%, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: hsla(223, 47%, 25%, 0.8);
  border-color: hsla(223, 47%, 45%, 0.5);
  color: #fff;
}

.btn-full {
  width: 100%;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon-only:hover {
  color: var(--color-red);
  background: hsla(355, 85%, 58%, 0.1);
}

.btn-danger-text {
  color: var(--text-muted);
}
.btn-danger-text:hover {
  color: var(--color-red) !important;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.badge-info {
  background: hsla(200, 95%, 55%, 0.15);
  color: var(--color-secondary);
  border: 1px solid hsla(200, 95%, 55%, 0.3);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: hsla(222, 47%, 5%, 0.85);
  backdrop-filter: blur(15px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid hsla(256, 95%, 66%, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

#loadingText {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 500;
}

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

/* AUTH SCREEN */
.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 10;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-glow);
}

.auth-header h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fff 40%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.step-guide {
  background: hsla(223, 47%, 9%, 0.45);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  border: 1px solid hsla(223, 47%, 20%, 0.6);
}

.step-guide h3 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.step-guide ol {
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.input-group label {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  background: hsla(223, 47%, 9%, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px hsla(256, 100%, 70%, 0.15);
  background: hsla(223, 47%, 9%, 0.85);
}

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

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* MAIN SCREEN */
.main-screen {
  flex: 1;
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.brand-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.brand span {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.boards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.boards-list li {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boards-list li i {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.boards-list li:hover {
  background: hsla(223, 47%, 20%, 0.5);
  color: #fff;
}

.boards-list li:hover i {
  color: var(--color-primary);
}

.boards-list li.active {
  background: linear-gradient(135deg, hsla(256, 95%, 66%, 0.15), hsla(200, 95%, 55%, 0.15));
  color: #fff;
  font-weight: 600;
  border: 1px solid hsla(256, 95%, 66%, 0.3);
}

.boards-list li.active i {
  color: var(--color-primary);
}

.loading-placeholder {
  color: var(--text-muted) !important;
  font-style: italic;
  cursor: default !important;
}
.loading-placeholder:hover {
  background: transparent !important;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: hsla(223, 47%, 9%, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-username {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.empty-state-content {
  max-width: 450px;
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.empty-state-icon {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.empty-state h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Dashboard View */
.dashboard-view {
  padding: 2.5rem;
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Board Header */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.board-title-wrapper h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fff 50%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.board-description {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn-icon-text {
  gap: 0.5rem;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.metric-card:hover {
  transform: translateY(-4px);
  border-color: hsla(223, 47%, 45%, 0.4);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.metric-icon.color-blue {
  background: hsla(210, 100%, 55%, 0.15);
  color: var(--color-blue);
}
.metric-icon.color-purple {
  background: hsla(270, 95%, 65%, 0.15);
  color: var(--color-purple);
}
.metric-icon.color-green {
  background: hsla(145, 80%, 42%, 0.15);
  color: var(--color-green);
}
.metric-icon.color-orange {
  background: hsla(35, 95%, 52%, 0.15);
  color: var(--color-orange);
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 320px;
}

.card-span-2 {
  grid-column: span 2;
}

.card-span-3 {
  grid-column: span 3;
}

.chart-header {
  margin-bottom: 1.5rem;
}

.flex-row.justify-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-body {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.8rem 1rem;
  border-bottom: 1.5px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.data-table tbody tr:hover {
  background: hsla(223, 47%, 20%, 0.3);
}

/* Member list styling inside tables */
.member-avatars {
  display: flex;
  gap: -6px;
}
.member-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-main);
  margin-right: -6px;
  cursor: default;
}

/* Labels custom chip */
.labels-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 180px;
}

.label-chip {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Date status classes */
.date-badge {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.date-overdue {
  color: var(--color-red);
}
.date-soon {
  color: var(--color-orange);
}
.date-completed {
  color: var(--color-green);
}
.date-normal {
  color: var(--text-muted);
}

/* Table header actions */
.table-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-box {
  position: relative;
}

.search-box input {
  background: hsla(223, 47%, 9%, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  width: 220px;
}

.search-box input:focus {
  border-color: var(--border-focus);
  outline: none;
  background: hsla(223, 47%, 9%, 0.8);
}

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

.select-input {
  background: hsla(223, 47%, 20%, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.select-input:focus {
  border-color: var(--border-focus);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .card-span-2, .card-span-3 {
    grid-column: span 1;
  }
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .boards-list {
    max-height: 150px;
  }
  .main-screen {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .main-content {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 480px) {
  .board-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .board-actions {
    align-items: flex-start !important;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-view {
    padding: 1rem;
  }
  .auth-card {
    padding: 1.5rem;
  }
  .kanban-column {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding: 1rem;
  }
}

/* PDF Analysis Modal & Styles */
.pdf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: hsla(222, 47%, 5%, 0.85);
  backdrop-filter: blur(15px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pdf-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.pdf-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: hsla(223, 47%, 9%, 0.3);
}

.pdf-modal-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.modal-label {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 1.5px;
}

#modalPdfName {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 2.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}
.btn-close-modal:hover {
  color: #fff;
}

.pdf-modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.pdf-analysis-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.analysis-col-left, .analysis-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analysis-card {
  background: hsla(223, 47%, 9%, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.analysis-card h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid hsla(223, 47%, 35%, 0.25);
  padding-bottom: 0.5rem;
}

.analysis-card h4 i {
  color: var(--color-primary);
}

.doc-class-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, hsla(256, 95%, 66%, 0.15), hsla(200, 95%, 55%, 0.15));
  border: 1px solid hsla(256, 95%, 66%, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.doc-text-summary {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: hsla(223, 47%, 9%, 0.5);
  padding: 1rem;
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.metadata-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.metadata-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  border-bottom: 1px dashed hsla(223, 47%, 30%, 0.25);
  padding-bottom: 0.4rem;
}
.metadata-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.metadata-list li span {
  color: var(--text-muted);
}

.metadata-list li strong {
  color: #fff;
  font-weight: 600;
}

.extracted-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 150px;
  overflow-y: auto;
}

.extracted-chip {
  background: hsla(223, 47%, 20%, 0.4);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.extracted-chip i {
  color: var(--color-secondary);
  font-size: 0.7rem;
}

.no-chips-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Button link direct styling */
.link-direct {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}
.link-direct:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .pdf-analysis-grid {
    grid-template-columns: 1fr;
  }
  .pdf-modal-content {
    max-height: 95vh;
  }
}

/* Kanban Board Styling */
.trello-kanban-board {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
  box-sizing: border-box;
}

#proposalsDashboardCard,
#proposalsDashboardContent {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.kanban-column {
  flex: 1;
  min-width: 300px;
  max-width: 380px;
  background: hsla(223, 47%, 9%, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  max-height: 72vh;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsla(223, 47%, 30%, 0.25);
}

.column-header h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.column-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}
.column-dot.color-blue {
  background-color: var(--color-blue);
  box-shadow: 0 0 8px var(--color-blue);
}
.column-dot.color-orange {
  background-color: var(--color-orange);
  box-shadow: 0 0 8px var(--color-orange);
}
.column-dot.color-green {
  background-color: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
}
.column-dot.color-purple {
  background-color: var(--color-purple);
  box-shadow: 0 0 8px var(--color-purple);
}

.column-badge {
  background: hsla(223, 47%, 20%, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: auto;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.25rem;
  min-height: 100px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: default;
}
.kanban-card:hover {
  transform: translateY(-3px);
  border-color: hsla(223, 47%, 45%, 0.5);
  box-shadow: var(--shadow-md);
}

.kanban-card-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
}

.kanban-card-client {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kanban-card-value {
  background: hsla(145, 80%, 42%, 0.12);
  border: 1px solid hsla(145, 80%, 42%, 0.25);
  color: var(--color-green);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
}

.kanban-card-clause {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: hsla(223, 47%, 9%, 0.4);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 42px;
}

.kanban-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.1rem;
  border-top: 1px solid hsla(223, 47%, 30%, 0.15);
  padding-top: 0.5rem;
}

.column-empty-state {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.82rem;
  padding: 2rem 1rem;
  border: 1px dashed hsla(223, 47%, 30%, 0.3);
  border-radius: var(--radius-md);
}

@media (max-width: 900px) {
  .trello-kanban-board {
    flex-direction: column;
    align-items: stretch;
  }
  .kanban-column {
    max-width: 100%;
    max-height: 450px;
  }
}

/* Consolidated Column Styles */
.consolidated-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.consolidated-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
  transform: translateY(-2px);
}

.consolidated-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consolidated-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.consolidated-value {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.consolidated-value.value-solicitados {
  color: var(--color-blue);
  text-shadow: 0 0 8px rgba(0, 150, 255, 0.2);
}

.consolidated-value.value-negociacoes {
  color: var(--color-orange);
  text-shadow: 0 0 8px rgba(255, 150, 0, 0.2);
}

.consolidated-value.value-fechados {
  color: var(--color-green);
  text-shadow: 0 0 8px rgba(0, 255, 150, 0.2);
}

.consolidated-divider {
  border: 0;
  height: 1px;
  background: hsla(223, 47%, 30%, 0.25);
  margin: 0.2rem 0;
}

.consolidated-item.total .consolidated-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.consolidated-item.total .consolidated-value {
  font-size: 1.35rem;
  color: var(--color-purple);
  text-shadow: 0 0 10px rgba(180, 100, 255, 0.3);
}

/* Monthly Card Breakdown Styles */
.monthly-card-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  background: hsla(223, 47%, 9%, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.monthly-card-item:hover {
  border-color: var(--color-purple);
  box-shadow: 0 0 10px rgba(180, 100, 255, 0.15);
}

.monthly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-weight: 700;
  color: var(--color-purple);
  font-size: 0.85rem;
  border-bottom: 1px solid hsla(223, 47%, 30%, 0.2);
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
}

.monthly-card-header-total {
  font-family: var(--font-title);
}

.monthly-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.monthly-card-row-value {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--text-primary);
}

.monthly-card-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  margin-right: 5px;
}
.monthly-card-dot.blue { background-color: var(--color-blue); }
.monthly-card-dot.orange { background-color: var(--color-orange); }
.monthly-card-dot.green { background-color: var(--color-green); }

/* Sidebar toggle and transitions */
.sidebar {
  transition: margin-left var(--transition-normal), transform var(--transition-normal);
}

.sidebar.collapsed {
  margin-left: -280px;
}

/* Floating expand button */
.btn-expand-sidebar {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 99;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-expand-sidebar:hover {
  background: hsla(223, 47%, 20%, 0.8);
  color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* When sidebar is NOT collapsed, hide the expand button */
.sidebar:not(.collapsed) ~ .main-content .btn-expand-sidebar {
  display: none !important;
}

/* Adjust paddings for content when sidebar is collapsed */
.sidebar.collapsed ~ .main-content .dashboard-view,
.sidebar.collapsed ~ .main-content .empty-state {
  padding-left: 5.5rem;
  transition: padding-left var(--transition-normal);
}

/* Transitions for when expanding the sidebar back */
.sidebar:not(.collapsed) ~ .main-content .dashboard-view,
.sidebar:not(.collapsed) ~ .main-content .empty-state {
  padding-left: 2.5rem;
  transition: padding-left var(--transition-normal);
}

/* Responsive collapse behavior for small screens (mobiles/tablets) */
@media (max-width: 1024px) {
  .sidebar.collapsed {
    margin-left: 0;
    display: none !important;
  }
  
  .btn-expand-sidebar {
    top: 1rem;
    left: 1rem;
  }

  .sidebar.collapsed ~ .main-content .dashboard-view,
  .sidebar.collapsed ~ .main-content .empty-state {
    padding-left: 1rem;
    padding-top: 4.5rem;
  }
}


