/* ==========================================================================
   Design System & Variables (APPLE LIQUID GLASS THEME)
   ========================================================================== */
:root {
  /* Color Palette (Clean iOS/macOS inspired light palette) */
  --bg-app: #f4f6fb;
  --bg-glass: rgba(255, 255, 255, 0.55);
  --bg-glass-card: rgba(255, 255, 255, 0.75);
  --bg-column: rgba(255, 255, 255, 0.35);
  --border-glass: rgba(255, 255, 255, 0.6);
  --border-color: rgba(15, 23, 42, 0.05);
  --border-color-hover: rgba(15, 23, 42, 0.12);
  
  --text-main: #1d1d1f;       /* Apple San Francisco Dark */
  --text-muted: #86868b;      /* Apple San Francisco Gray */
  --text-light: #aeaeb2;      /* Apple San Francisco Light Gray */
  
  /* Accent Colors */
  --color-primary: hsl(244, 85%, 60%);
  --color-primary-glow: hsla(244, 85%, 60%, 0.12);
  --color-primary-gradient: linear-gradient(135deg, hsl(244, 85%, 60%) 0%, hsl(265, 80%, 55%) 100%);
  --color-liquid-gradient: linear-gradient(90deg, hsl(244, 85%, 60%) 0%, hsl(190, 85%, 50%) 100%);
  
  /* Status Colors */
  --status-dopyt: hsl(199, 90%, 42%);          /* Ice Blue */
  --status-nacenene: hsl(40, 95%, 45%);         /* Gold Amber */
  --status-vo-vyrobe: hsl(14, 90%, 52%);        /* Coral Orange */
  --status-schvalene: hsl(142, 70%, 38%);       /* Emerald */
  --status-caka-na-fa: hsl(330, 85%, 52%);      /* Hot Magenta */
  --status-dokoncene: hsl(172, 80%, 35%);       /* Mint Green */

  /* UI Helpers */
  --color-danger: hsl(354, 85%, 48%);
  --color-success: hsl(142, 70%, 38%);
  --color-warning: hsl(40, 95%, 45%);
  
  /* Typography */
  --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Shadows & Blur */
  --shadow-sm: 0 2px 8px rgba(31, 38, 135, 0.03);
  --shadow-md: 0 8px 32px 0 rgba(31, 38, 135, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --shadow-lg: 0 20px 40px 0 rgba(31, 38, 135, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow-primary: 0 4px 16px rgba(99, 102, 241, 0.25);
  
  --blur-amount: 25px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  /* Layout */
  --header-height: 185px;
}

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

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.45;
  
  /* Apple Liquid Gradient Wallpaper Simulation */
  background-image: 
    radial-gradient(circle at 10% 20%, hsla(244, 85%, 65%, 0.07) 0px, transparent 45%),
    radial-gradient(circle at 90% 10%, hsla(190, 85%, 60%, 0.07) 0px, transparent 40%),
    radial-gradient(circle at 50% 80%, hsla(325, 80%, 65%, 0.04) 0px, transparent 45%),
    radial-gradient(circle at 80% 90%, hsla(265, 80%, 60%, 0.04) 0px, transparent 40%);
  background-attachment: fixed;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Utility spacing classes
   ========================================================================== */
.margin-bottom-sm { margin-bottom: 0.5rem; }
.margin-bottom-md { margin-bottom: 0.75rem; }
.margin-bottom-lg { margin-bottom: 1.25rem; }
.margin-bottom-xl { margin-bottom: 1.75rem; }

/* ==========================================================================
   1. Prihlasovacia Obrazovka (Secure Login Screen Overlay)
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(244, 246, 251, 0.85);
  background-image: 
    radial-gradient(circle at 30% 30%, hsla(244, 85%, 65%, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, hsla(190, 85%, 60%, 0.08) 0%, transparent 45%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  backdrop-filter: blur(20px);
}

.login-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.25rem;
  gap: 0.75rem;
}

.login-logo-image {
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.06));
}

.login-logo h2 {
  font-family: var(--font-family-title);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.login-logo p {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.login-error {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1.25rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   2. Main Layout Container
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.25rem 1.75rem 1.75rem 1.75rem;
  max-width: 1920px;
  margin: 0 auto;
  gap: 1.25rem;
}

/* ==========================================================================
   Header Component (Liquid Glass Design)
   ========================================================================== */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(190%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-image {
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.04));
}

.logo-text h1 {
  font-family: var(--font-family-title);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.logo-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: -3px;
}

/* Synchronization Status Indicator */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  user-select: none;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.sync-success {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
}
.sync-success .sync-dot {
  background-color: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.sync-saving {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.12);
}
.sync-saving .sync-dot {
  background-color: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
  animation: pulse-sync 1.2s infinite ease-in-out;
}

.sync-error {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
}
.sync-error .sync-dot {
  background-color: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
}

@keyframes pulse-sync {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

/* Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--text-light);
  pointer-events: none;
}

.search-box input {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 0.6rem 1.15rem 0.6rem 2.65rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  font-weight: 500;
  width: 260px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  width: 320px;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  padding-top: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.stat-icon.icon-blue {
  background: rgba(99, 102, 241, 0.08);
  color: var(--color-primary);
}

.stat-icon.icon-orange {
  background: rgba(245, 158, 11, 0.08);
  color: #e07a00;
}

.stat-icon.icon-green {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

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

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.stat-value {
  font-family: var(--font-family-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.backup-controls {
  display: flex;
  gap: 0.6rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  filter: saturate(1.15) brightness(1.05);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--bg-glass-card);
  color: var(--text-main);
  border-color: var(--border-glass);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn-secondary-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(0, 0, 0, 0.06);
}

.btn-secondary-outline:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.06);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--color-danger);
}

.btn-icon {
  padding: 0.6rem;
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ==========================================================================
   Workspace Layout (Canvas + Sidebar)
   ========================================================================== */
.workspace-wrapper {
  display: flex;
  gap: 1.5rem;
  flex-grow: 1;
  min-height: 0;
  height: calc(100vh - var(--header-height) - 60px);
}

/* Kanban Board Canvas */
.board-canvas {
  display: flex;
  gap: 1.15rem;
  flex-grow: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.75rem;
  min-width: 0;
}

/* ==========================================================================
   Kanban Columns Design (Liquid Glass Style)
   ========================================================================== */
.board-column {
  background: var(--bg-column);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  width: 290px;
  min-width: 270px;
  max-width: 330px;
  height: 100%;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.board-column.drag-over {
  border-color: var(--color-primary);
  background-color: rgba(99, 102, 241, 0.03);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.05);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  cursor: grab;
  user-select: none;
}

.column-header:active {
  cursor: grabbing;
}

.board-column.column-dragging {
  opacity: 0.4;
  transform: scale(0.97) rotate(0.5deg);
  border: 1.5px dashed var(--color-primary);
  box-shadow: var(--shadow-lg);
}


.column-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.column-title-wrapper h2 {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
}

.column-count {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.column-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Column Body / Dropzone */
.column-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* ==========================================================================
   Project Cards Design (Frosted Liquid Glass Card)
   ========================================================================== */
.project-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: grab;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease, 
              box-shadow 0.3s ease, 
              opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(31, 38, 135, 0.02);
  user-select: none;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.025) translateY(-3px);
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
}

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

/* Drag State Styling */
.project-card.dragging {
  opacity: 0.35;
  transform: rotate(1deg) scale(0.96);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

/* Card Content */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
}

.client-name {
  font-family: var(--font-family-title);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.project-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  border-top: 1px solid rgba(0, 0, 0, 0.02);
  padding-top: 0.65rem;
  margin-top: 0.4rem;
}

.meta-price {
  font-family: var(--font-family-title);
  font-weight: 700;
  color: #059669; /* Rich Green */
}

/* Deadline styles */
.meta-deadline {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.meta-deadline.deadline-danger {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.meta-deadline.deadline-warning {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.1);
}

.btn-edit-card {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.project-card:hover .btn-edit-card {
  opacity: 1;
}

.btn-edit-card:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

/* Card border left stripe */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background-color: var(--card-accent-color, var(--text-light));
}

/* ==========================================================================
   3. Sidebar - Ciele (Glassmorphic Sidebar)
   ========================================================================== */
.goals-sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

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

.sidebar-icon {
  color: var(--color-primary);
}

.sidebar-header h2 {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Financial Targets UI styling */
.financial-targets {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.financial-targets .target-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.target-info {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

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

.target-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.target-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.target-input-wrapper:focus-within {
  background: #ffffff;
  border-color: var(--color-primary);
}

.target-input-wrapper input {
  width: 58px;
  border: none;
  background: transparent;
  padding: 0;
  text-align: right;
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.target-input-wrapper input:focus {
  outline: none;
}

/* Chrome, Safari, Edge, Opera: remove spinner arrows */
.target-input-wrapper input::-webkit-outer-spin-button,
.target-input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox: remove spinner arrows */
.target-input-wrapper input[type=number] {
  -moz-appearance: textfield;
}

.target-input-wrapper span {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 1px;
  color: var(--text-muted);
}

.target-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.target-actual {
  font-family: var(--font-family-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.target-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Liquid Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-liquid-gradient);
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Monthly History list styles */
.monthly-history-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.monthly-history-row:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.8);
}

.monthly-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.monthly-history-month {
  font-family: var(--font-family-title);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.monthly-history-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.monthly-history-badge.badge-success {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
}

.monthly-history-badge.badge-fail {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.monthly-history-progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.monthly-history-bar-bg {
  height: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
  width: 100%;
}

.monthly-history-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.monthly-history-bar-fill.fill-success {
  background: var(--color-success);
}

.monthly-history-bar-fill.fill-fail {
  background: var(--color-primary);
}

/* ==========================================================================
   Modals & Dialogs Layout (Apple Frosted Glass Overlay)
   ========================================================================== */
dialog {
  margin: auto;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass-card);
  backdrop-filter: blur(var(--blur-amount));
  color: var(--text-main);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), display 0.35s allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.96);
  }
}

dialog::backdrop {
  background-color: rgba(31, 38, 135, 0.15);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease, display 0.35s allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
  }
}

.modal-content {
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.modal-header h2 {
  font-family: var(--font-family-title);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

/* Form inputs styling */
#projectForm {
  padding: 1.5rem 1.75rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2386868b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem;
  padding-right: 2.25rem;
}

textarea {
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  padding-top: 1.25rem;
}

.modal-footer-right {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
}

/* ==========================================================================
   Columns Manager Editor Modal
   ========================================================================== */
.columns-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 270px;
  overflow-y: auto;
  padding: 2px;
}

.column-manage-row {
  display: grid;
  grid-template-columns: 1.8fr 1.1fr 0.2fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.column-manage-row input[type="text"] {
  padding: 0.5rem;
  font-size: 0.85rem;
}

.invoiced-chk-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.invoiced-chk-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.btn-delete-column {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s ease;
}

.btn-delete-column:hover {
  color: var(--color-danger);
}

/* Backup and Drag Areas */
.modal-body {
  padding: 1.25rem 1.75rem;
}

.import-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
  line-height: 1.45;
}

.file-drop-area {
  border: 2px dashed rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.file-drop-area svg {
  color: var(--text-light);
  transition: color 0.3s ease, transform 0.3s ease;
}

.file-drop-area:hover,
.file-drop-area.drag-over {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.55);
}

.file-drop-area:hover svg,
.file-drop-area.drag-over svg {
  color: var(--color-primary);
  transform: translateY(-4px);
}

.file-drop-area p {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hidden-file-input {
  display: none;
}

.error-msg {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-top: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ==========================================================================
   Notification Toast System
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-glass-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 11000;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-success { border-left: 4px solid var(--color-success); color: #047857; }
.toast-error { border-left: 4px solid var(--color-danger); color: #b91c1c; }
.toast-info { border-left: 4px solid var(--color-primary); color: #4338ca; }

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1400px) {
  .workspace-wrapper {
    flex-direction: column;
    height: auto;
    gap: 1.5rem;
  }
  
  .board-canvas {
    max-height: 580px;
    height: auto;
  }
  
  .goals-sidebar {
    width: 100%;
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem 1rem 1.25rem 1rem;
  }
  
  .app-header {
    padding: 1.15rem;
  }
  
  .header-main {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box input {
    width: 100%;
  }
  
  .search-box input:focus {
    width: 100%;
  }
  
  .stats-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .column-manage-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  
  .btn-delete-column {
    align-self: flex-end;
  }
}
