/* ==========================================================================
   DESIGN SYSTEM - VAUTEX DASHBOARD
   A premium glassmorphic theme supporting dark and light modes.
   ========================================================================== */

/* Google Fonts Imports are handled in HTML */

:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #121826;
  --bg-card: rgba(18, 24, 38, 0.65);
  --bg-card-hover: rgba(25, 33, 52, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-color: #6366f1; /* Electric Indigo */
  --accent-light: #818cf8;
  --accent-rgb: 99, 102, 241;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  
  /* Priority Colors */
  --priority-critical: #f43f5e;   /* Rose Neon */
  --priority-high: #f59e0b;       /* Amber Warm */
  --priority-medium: #3b82f6;     /* Electric Blue */
  --priority-low: #10b981;        /* Emerald Green */
  
  --priority-critical-bg: rgba(244, 63, 94, 0.15);
  --priority-high-bg: rgba(245, 158, 11, 0.15);
  --priority-medium-bg: rgba(59, 130, 246, 0.15);
  --priority-low-bg: rgba(16, 185, 129, 0.15);
  
  /* Category Colors */
  --cat-video: #ff4500;
  --cat-photo: #00ffff;
  --cat-design: #da70d6;
  --cat-audio: #adff2f;
  --cat-other: #b0c4de;

  /* Shadows & Radius */
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.2);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-opacity: 0.15;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f4f6fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-card: rgba(0, 0, 0, 0.06);
  --border-input: rgba(0, 0, 0, 0.1);
  
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --accent-color: #4f46e5;
  --accent-light: #6366f1;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  
  --priority-critical-bg: rgba(244, 63, 94, 0.1);
  --priority-high-bg: rgba(245, 158, 11, 0.1);
  --priority-medium-bg: rgba(59, 130, 246, 0.1);
  --priority-low-bg: rgba(16, 185, 129, 0.1);
  
  --shadow-premium: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.1);
  --glow-opacity: 0.06;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

body {
  font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.5s ease, color 0.3s ease;
}

/* Modern Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-input);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Background Animated/Blurred Glows */
.glow-bg {
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: -1;
  opacity: var(--glow-opacity);
  transition: opacity 0.5s ease;
}

.glow-1 {
  background: var(--accent-color);
  top: -10%;
  right: -5%;
}

.glow-2 {
  background: #a855f7;
  bottom: -10%;
  left: -5%;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.app-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 0;
  transition: var(--transition-smooth);
}

.header-logo:hover {
  transform: translateY(-1px);
}

.header-logo:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 6px;
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.logo-text h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.user-pill strong {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.live-clock {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

[data-theme="light"] .live-clock {
  background: rgba(0, 0, 0, 0.03);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--priority-low);
  border-radius: 50%;
  animation: pulseGlow 2s infinite;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.03);
}

.theme-toggle-btn:hover {
  background: var(--accent-color);
  color: #fff;
  transform: rotate(15deg) scale(1.05);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* ==========================================================================
   METRICS SECTION
   ========================================================================== */

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: var(--shadow-glow);
}

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

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

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.metric-icon.bg-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.metric-icon.bg-red { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }
.metric-icon.bg-orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.metric-icon.bg-green { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.glow-alert {
  animation: glowPulseRed 2s infinite;
}

/* ==========================================================================
   FILTERS SECTION
   ========================================================================== */

.filters-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-premium);
}

@media (min-width: 768px) {
  .filters-section {
    flex-direction: row;
    align-items: center;
  }
}

.search-wrapper {
  position: relative;
  flex: 1;
}

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

.search-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

[data-theme="light"] .search-wrapper input {
  background: rgba(0, 0, 0, 0.02);
}

.search-wrapper input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.filters-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 768px) {
  .filters-group {
    width: min(100%, 820px);
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    align-items: center;
  }
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  padding: 12px 36px 12px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

[data-theme="light"] .select-wrapper select {
  background: rgba(0, 0, 0, 0.02);
}

.select-wrapper select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Custom dropdown arrow */
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-secondary);
  pointer-events: none;
}

/* ==========================================================================
   MAIN LAYOUT GRID
   ========================================================================== */

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr 380px;
  }
}

/* --------------------------------------------------------------------------
   PROJECTS CONTAINER (LEFT)
   -------------------------------------------------------------------------- */

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-bar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-title-bar h2 span {
  color: var(--accent-color);
}

.title-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Buttons Styling */
.primary-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: var(--transition-smooth);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

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

.icon-text-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.primary-btn:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

.event-group {
  grid-column: 1 / -1;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-premium);
}

.event-group-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.25rem 0.25rem 1rem;
  border-bottom: 1px solid var(--border-card);
}

.event-kicker {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-group-header h3 {
  margin-top: 4px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.event-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.event-summary span,
.event-summary strong {
  border: 1px solid var(--border-card);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .event-summary span,
[data-theme="light"] .event-summary strong {
  background: rgba(0, 0, 0, 0.03);
}

.event-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding-top: 1rem;
}

/* Empty State Styling */
.empty-state {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
}

.empty-state svg {
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* ==========================================================================
   PROJECT CARD DESIGN (WOW EFFECT)
   ========================================================================== */

.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* Hover effects */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 5px;
  background: var(--priority-color, var(--priority-medium));
  transition: var(--transition-smooth);
}

.project-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .project-card:hover {
  box-shadow: 0 12px 36px 0 rgba(31, 38, 135, 0.08);
}

/* Glow ring under card for Critical priority */
.project-card.urgente-glow {
  animation: shadowPulseRed 2.5s infinite;
}

.project-card.completed {
  opacity: 0.65;
}

.project-card.completed::before {
  background: var(--text-muted) !important;
}

.project-card.completed:hover {
  opacity: 0.85;
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cat-color, #fff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--cat-color, var(--border-card));
  padding: 4px 10px;
  border-radius: 50px;
}

.priority-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--prio-color);
  background: var(--prio-bg);
  border: 1px solid rgba(var(--prio-color-rgb, 255, 255, 255), 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Card Body */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.project-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  /* Line clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Meta Details */
.card-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 6px 0;
  padding: 10px 0;
  border-top: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meta-item svg {
  color: var(--text-muted);
}

.meta-item.urgente-deadline {
  color: var(--priority-critical);
  font-weight: 600;
}

.meta-item.urgente-deadline svg {
  color: var(--priority-critical);
  animation: shake 1s infinite alternate;
}

/* Card Actions Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.status-toggle input {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-input);
  border-radius: 6px;
  display: inline-block;
  position: relative;
  transition: var(--transition-smooth);
}

.status-toggle:hover .custom-checkbox {
  border-color: var(--accent-color);
}

.status-toggle input:checked + .custom-checkbox {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.status-toggle input:checked + .custom-checkbox::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

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

.action-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

[data-theme="light"] .action-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.action-btn.edit-btn:hover {
  color: var(--accent-light);
}

.action-btn.delete-btn:hover {
  color: var(--priority-critical);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   SIDEBAR CONTAINER (RIGHT)
   ========================================================================== */

.sidebar-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-premium);
}

.sidebar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card h3 svg {
  color: var(--accent-color);
}

/* Calendar Card Header */
.sidebar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.sidebar-card-header h3 {
  margin-bottom: 0;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-controls button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

[data-theme="light"] .calendar-controls button {
  background: rgba(0, 0, 0, 0.03);
}

.calendar-controls button:hover {
  background: var(--accent-color);
  color: #fff;
}

#calendar-month-year {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: capitalize;
  min-width: 80px;
  text-align: center;
}

/* Calendar Grid */
.calendar-wrapper {
  display: flex;
  flex-direction: column;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.calendar-day:hover:not(.empty-day) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .calendar-day:hover:not(.empty-day) {
  background: rgba(0, 0, 0, 0.03);
}

.calendar-day.empty-day {
  cursor: default;
  opacity: 0.15;
}

.calendar-day.today {
  border: 1.5px solid var(--accent-color);
  font-weight: 800;
  color: var(--accent-light);
}

.calendar-day.has-deadline {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 700;
}

/* Delivery Indicator Dots */
.delivery-dots {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 3px;
  justify-content: center;
}

.calendar-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.calendar-dot.critical { background: var(--priority-critical); }
.calendar-dot.high { background: var(--priority-high); }
.calendar-dot.medium { background: var(--priority-medium); }
.calendar-dot.low { background: var(--priority-low); }

.calendar-legend {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-card);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.legend-item .dot.critico { background: var(--priority-critical); }
.legend-item .dot.alto { background: var(--priority-high); }
.legend-item .dot.medio { background: var(--priority-medium); }
.legend-item .dot.bajo { background: var(--priority-low); }

/* Distribution Bars */
.distribution-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.dist-row {
  display: grid;
  grid-template-columns: 70px 1fr 24px;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.dist-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .progress-track {
  background: rgba(0, 0, 0, 0.03);
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.bg-critical { background: var(--priority-critical); box-shadow: 0 0 8px rgba(244, 63, 94, 0.4); }
.progress-fill.bg-high { background: var(--priority-high); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.progress-fill.bg-medium { background: var(--priority-medium); box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.progress-fill.bg-low { background: var(--priority-low); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.dist-count {
  font-weight: 700;
  text-align: right;
  color: var(--text-primary);
}

.urgency-list,
.workload-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.urgency-row,
.workload-row {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-smooth);
}

[data-theme="light"] .urgency-row,
[data-theme="light"] .workload-row {
  background: rgba(0, 0, 0, 0.03);
}

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

.urgency-row strong {
  min-width: 32px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--priority-critical-bg);
  color: var(--priority-critical);
}

.urgency-row:hover,
.urgency-row.active,
.workload-row:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.urgency-row.active {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.workload-row {
  text-align: left;
}

.workload-row-header,
.workload-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.workload-row-header strong {
  font-size: 0.9rem;
}

.workload-row-header span,
.workload-meta {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.workload-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0.55rem 0;
}

[data-theme="light"] .workload-track {
  background: rgba(0, 0, 0, 0.08);
}

.workload-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
}

.muted-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ==========================================================================
   MODAL / DIALOG DESIGN (GLASSMORPHISM EFFECT)
   ========================================================================== */

.glass-dialog {
  margin: auto;
  border: 1px solid var(--border-card);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-premium);
  color: #f3f4f6;
  outline: none;
  overflow-y: auto;
  max-height: 90vh;
  /* Native dialog entry animation */
  animation: dialogScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .glass-dialog {
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
}

.glass-dialog::backdrop {
  background: rgba(8, 11, 17, 0.75);
  backdrop-filter: blur(8px);
  animation: backdropFadeIn 0.3s ease;
}

.admin-dialog {
  max-width: 860px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 760px) {
  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-grid h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.admin-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.admin-user-row,
.audit-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.admin-user-row div,
.audit-row {
  min-width: 0;
}

.admin-user-row span,
.audit-row span,
.audit-row small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.admin-user-row input {
  width: 100%;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 11, 17, 0.86);
  backdrop-filter: blur(16px);
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow-premium);
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.login-brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.login-brand h2 {
  font-size: 1.2rem;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.login-error {
  min-height: 18px;
  color: var(--priority-critical);
  font-size: 0.85rem;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.dialog-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.close-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.close-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .col-full {
    grid-column: span 2;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.required {
  color: var(--priority-critical);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-input);
  color: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
  background: rgba(0, 0, 0, 0.01);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border-card);
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes pulseGlow {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes glowPulseRed {
  0% { box-shadow: 0 0 5px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 18px rgba(244, 63, 94, 0.5); }
  100% { box-shadow: 0 0 5px rgba(244, 63, 94, 0.2); }
}

@keyframes shadowPulseRed {
  0% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 4px rgba(244, 63, 94, 0.15); border-color: var(--border-card); }
  50% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 16px rgba(244, 63, 94, 0.45); border-color: rgba(244, 63, 94, 0.35); }
  100% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 4px rgba(244, 63, 94, 0.15); border-color: var(--border-card); }
}

@keyframes dialogScaleUp {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes shake {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-card);
  margin-top: auto;
}
