/* ==========================================================================
   TaskFlow Pro - Aesthetic Clean Rounded UI Design System
   ========================================================================== */

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

:root {
  /* Dynamic Light Theme Palette - Vinotinto / Burgundy */
  --bg-main: #f5f6fa;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-solid: #ffffff;
  --bg-pill: #eaeef5;
  --bg-input: #f8fafc;
  --border-color: rgba(226, 232, 240, 0.85);
  --border-color-hover: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary-color: #800020;
  --primary-hover: #5c0017;
  --primary-light: #fdf2f4;

  --success-color: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;

  --warning-color: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fffbeb;

  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;

  --accent-glow: rgba(128, 0, 32, 0.15);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 50px;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Theme Palette - Vibrant Vinotinto Accent */
  --bg-main: #0b0f17;
  --bg-card: rgba(21, 29, 44, 0.85);
  --bg-card-solid: #151d2c;
  --bg-pill: #1e293b;
  --bg-input: #0f172a;
  --border-color: rgba(51, 65, 85, 0.6);
  --border-color-hover: #475569;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --primary-color: #c0395e;
  --primary-hover: #d64a70;
  --primary-light: rgba(192, 57, 94, 0.18);

  --success-color: #10b981;
  --success-hover: #34d399;
  --success-light: rgba(16, 185, 129, 0.15);

  --warning-color: #f59e0b;
  --warning-hover: #fbbf24;
  --warning-light: rgba(245, 158, 11, 0.15);

  --danger-color: #f43f5e;
  --danger-hover: #fb7185;
  --danger-light: rgba(244, 63, 94, 0.15);

  --accent-glow: rgba(192, 57, 94, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  padding-bottom: 3rem;
}

/* App Container */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
}

/* Header & Nav Bar */
.navbar-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 100;
  margin-bottom: 2rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

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

.theme-toggle-header-btn {
  background: var(--bg-pill);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.theme-toggle-header-btn:hover {
  background: var(--border-color-hover);
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-header-btn .svg-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
  transition: transform 0.3s ease, color 0.3s ease;
}

.theme-icon-sun {
  color: #f59e0b;
}

.theme-icon-moon {
  color: #6366f1;
}



.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  background: var(--bg-pill);
  padding: 0.3rem;
  border-radius: var(--radius-pill);
  gap: 0.25rem;
  list-style: none;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--bg-card-solid);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

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

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.35s ease-in-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Header */
.section-title-box {
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

/* Card Containers */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-color-hover);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.grid-work-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

@media (max-width: 992px) {

  .grid-work-layout,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem 0.75rem;
  }

  .navbar-wrapper {
    top: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .navbar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-lg);
    align-items: center;
  }

  .brand {
    font-size: 1.3rem;
  }

  .nav-links {
    width: 100%;
    justify-content: space-around;
    padding: 0.25rem;
    gap: 0.15rem;
  }

  .nav-btn {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    gap: 0.4rem;
  }

  .unified-panel {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 480px) {
  .nav-btn {
    padding: 0.5rem 0.6rem;
  }

  .nav-btn span {
    font-size: 0.9rem;
  }

  .nav-btn .svg-icon {
    width: 1.2em;
    height: 1.2em;
  }
}

/* Forms & Control Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-label .req {
  color: var(--danger-color);
}

.form-control {
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 0.8rem 1.1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg-card-solid);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Timer Section Visuals */
.timer-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(145deg, var(--bg-card-solid), var(--bg-card));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.timer-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0.6;
}

.timer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  background: var(--bg-pill);
  color: var(--text-secondary);
}

.timer-status-pill.running {
  background: var(--success-light);
  color: var(--success-color);
}

.timer-status-pill.paused {
  background: var(--warning-light);
  color: var(--warning-color);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.timer-status-pill.running .pulse-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1.1);
    opacity: 0.8;
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.timer-display {
  font-family: 'Outfit', monospace;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1;
  word-break: break-word;
  text-align: center;
  width: 100%;
}

/* Action Controls Buttons */
.timer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 450px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  /* Safari fix: transición explícita en lugar de 'all' para evitar congelamientos */
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  -webkit-transition: -webkit-transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  /* Hint al GPU para evitar repaints en Safari */
  will-change: transform;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  /* Forzar repaint inmediato en Safari al cambiar a este estado */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.btn-success:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.btn-warning:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-black {
  background: #000000;
  color: #ffffff;
  border: 1px solid #111827;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-black:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .btn-black {
  background: #000000;
  color: #ffffff;
  border: 1px solid #374151;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-pill);
  border-color: var(--border-color-hover);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* History Filter Bar */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* History Records Table & Cards */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.records-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.records-table th {
  background: var(--bg-pill);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
}

.records-table th:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.records-table th:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.records-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.92rem;
  vertical-align: middle;
}

.records-table tr:last-child td {
  border-bottom: none;
}

.records-table tr:hover td {
  background: var(--bg-pill);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-client {
  background: var(--primary-light);
  color: var(--primary-color);
}

.badge-task {
  background: var(--bg-pill);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.duration-tag {
  font-family: 'Outfit', monospace;
  font-weight: 700;
  color: var(--primary-color);
}

.notes-preview {
  max-width: 250px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Client Directory Cards */
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.client-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

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

.client-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.client-detail-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Config & Tools List */
.export-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.export-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.export-box-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.export-box-excel .export-box-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.export-box-pdf .export-box-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.export-box-demo .export-box-icon {
  background: rgba(79, 70, 229, 0.15);
  color: #4f46e5;
}

/* Toast Notifications - Pop-up Flotante Inferior (No intrusivo) */
.toast-container {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 90vw;
  width: max-content;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.35rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon {
  width: 18px;
  height: 18px;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--bg-card-solid);
}
.toast-success .toast-icon {
  color: #10b981;
}

.toast-danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--bg-card-solid);
}
.toast-danger .toast-icon {
  color: #ef4444;
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--bg-card-solid);
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-card-solid);
}
.toast-info .toast-icon {
  color: #6366f1;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Popup de Filtros */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(90vh - 65px);
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-pill);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

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

/* History Actions & Active Badge */
.history-actions-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 0.3rem;
}

/* Tarjetas Individuales de Obras */
.history-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

@media (max-width: 768px) {
  .history-cards-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem 1.1rem;
    gap: 0.9rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .history-search-bar-row {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .history-search-bar-row .outer-search-input-box {
    flex: 1 1 100%;
  }

  .filter-slider-btn,
  #btnResetFiltersInline {
    flex: 1;
    justify-content: center;
  }

  .accordion-body {
    padding: 1rem;
  }

  .accordion-title {
    font-size: 1rem;
  }

  .export-card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .history-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* ── History Card Anatomy ──────────────────────────────────────────────── */

/* The card itself reuses .card base + history-card overrides */
.history-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-radius: var(--radius-md);
}

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

/* Header: title+client on left, badges+delete on right */
.history-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.history-client-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.history-task-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
  word-break: break-word;
}

/* Right side of header: badges + delete button */
.history-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-duration-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Outfit', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Notes area */
.history-notes {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-pill);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-color);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

/* Footer: date on left, time range on right */
.history-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Responsive: on tiny screens stack footer vertically */
@media (max-width: 380px) {
  .history-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .history-card-actions {
    justify-content: flex-start;
  }
}


.history-work-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

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

.history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-card-work-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.history-card-client-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  margin-top: 0.4rem;
}

.history-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.history-card-duration {
  font-family: 'Outfit', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-color);
}

.history-card-notes {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-pill);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* SVG Icon Helper */
.svg-icon {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.brand-icon .svg-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  stroke: #ffffff;
}

/* Unified Panel Container */
.unified-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.unified-panel:hover {
  border-color: var(--border-color-hover);
}

.panel-section {
  display: flex;
  flex-direction: column;
}

.timer-side-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(145deg, var(--bg-card-solid), var(--bg-card));
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.timer-side-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0.6;
}

/* Work Panel Flow Layout */
.work-panel-flow {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.work-panel-flow .accordion-item {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.work-panel-flow .accordion-item:hover {
  border-color: var(--border-color-hover);
}

.work-panel-flow .accordion-header {
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
}

.work-panel-flow .accordion-body {
  padding: 1.4rem;
}

/* Folded summary under Detalle accordion (lista li uno encima de otro) */
.work-folded-summary {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0.75rem auto 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  transition: var(--transition);
}

.accordion-item.collapsed + .work-folded-summary {
  display: flex;
}

.work-folded-summary li {
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  list-style: none;
}

/* Mandatory fields error highlight */
.field-error {
  border-color: var(--danger-color) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
  animation: inputShake 0.3s ease-in-out;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.work-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 640px) {
  .work-grid-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.work-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0 1.5rem 0;
  width: 100%;
}

.work-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0 0.5rem;
  width: 100%;
}

.work-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.work-button-wrapper .btn {
  padding: 0.95rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 0;
}

#btnStartPauseTimer {
  flex: 1.6;
}

#btnStopTimer {
  flex: 1;
}

@media (max-width: 480px) {
  .work-button-wrapper {
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
  }

  .work-button-wrapper .btn {
    width: 100%;
    flex: none;
  }
}

/* External Search Bar & Filter Slider Button in History */
.history-search-bar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.outer-search-input-box {
  position: relative;
  flex: 1;
}

.search-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 1.2rem;
  height: 1.2rem;
  pointer-events: none;
}

.outer-search-input {
  padding-left: 2.8rem !important;
  height: 46px;
}

.filter-slider-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 46px;
  padding: 0 1.25rem;
  border-radius: var(--radius-pill);
}

/* Setting Card para Conmutador de Tema en Configuración */
.theme-setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  gap: 1.5rem;
}

.theme-setting-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.theme-setting-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-setting-icon .svg-icon {
  width: 26px;
  height: 26px;
}

.theme-setting-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.theme-setting-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.theme-toggle-action-btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.danger-reset-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  gap: 1.25rem;
}

/* Floating Action Button (FAB) for Timer / Trabajar Shortcut */
.floating-timer-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-width: 95px;
  min-height: 95px;
  padding: 1.2rem 1.8rem;
  background: linear-gradient(135deg, var(--success-color), var(--success-hover));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  user-select: none;
}

.floating-timer-fab:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.floating-timer-fab:active {
  transform: translateY(-1px) scale(0.98);
}

.fab-icon-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-icon-box .svg-icon {
  width: 2.4em;
  height: 2.4em;
  stroke: #ffffff;
}

.fab-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary-color);
}

.fab-timer-text {
  font-family: 'Outfit', monospace;
  font-weight: 700;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {

  .theme-setting-card,
  .danger-reset-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-toggle-action-btn {
    width: 100%;
  }

  .history-search-bar-row {
    flex-wrap: wrap;
  }

  .timer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .floating-timer-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    min-width: 80px;
    min-height: 80px;
    padding: 1rem 1.4rem;
  }

  .fab-timer-text {
    font-size: 1.15rem;
  }
}

/* Accordion / Desplegables en Ajustes */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card-solid);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  font-family: var(--font-heading);
  text-align: left;
  transition: var(--transition);
}

.accordion-header:hover {
  background: var(--bg-pill);
}

.accordion-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.accordion-chevron {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.accordion-item.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

.accordion-body {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  transition: max-height 0.3s ease;
}

.accordion-item.collapsed .accordion-body {
  display: none;
}

/* ── Pricing System ────────────────────────────────────────────────────── */

/* Price badge on Obra/Client cards */
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  margin-top: 0.5rem;
}

/* Price field row in Work view */
.price-field-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-pill);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}

.price-field-row input[type="number"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
  min-width: 0;
}

.price-field-row input[type="number"]::-webkit-inner-spin-button,
.price-field-row input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.price-source-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-source-badge.source-manual {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

.price-source-badge.source-global {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
}

.price-source-badge.source-client {
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid rgba(128, 0, 32, 0.2);
}

.price-source-badge.source-obra {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid rgba(146, 64, 14, 0.2);
}

.price-source-badge.source-default {
  background: var(--bg-pill);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Price checkbox row in forms */
.price-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-pill);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.price-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--success-color);
  cursor: pointer;
  flex-shrink: 0;
}

.price-toggle-row label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  flex: 1;
}

.price-toggle-row .price-input-inline {
  width: 110px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card-solid);
  text-align: right;
  transition: var(--transition);
}

.price-toggle-row .price-input-inline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-pill);
}

.price-toggle-row .price-input-inline:focus {
  outline: none;
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Pricing Catalog Table */
.pricing-catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 1rem;
}

.pricing-catalog-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-catalog-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.pricing-catalog-table tr:last-child td {
  border-bottom: none;
}

.pricing-catalog-table tr:hover td {
  background: var(--bg-pill);
}

/* Amount badge in history cards */
.history-amount-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--success-light);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

/* Global price warning banner */
.global-price-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Datos Backup Module Styles */
.datos-backup-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.datos-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.datos-file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.datos-file-item:hover {
  border-color: var(--warning-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.datos-file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.datos-file-icon .svg-icon {
  width: 20px;
  height: 20px;
}

.datos-icon-client { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.datos-icon-obra { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.datos-icon-history { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.datos-icon-work { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.datos-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.datos-file-name {
  font-family: 'Outfit', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.datos-file-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.datos-file-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: var(--bg-pill);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .datos-file-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .datos-file-info {
    min-width: 150px;
    flex-basis: 100%;
  }
  .datos-file-badge {
    margin-left: auto;
  }
}

  /* Printable Report Modal & PDF Layout */
  @media print {
    body {
      background: #ffffff !important;
      color: #000000 !important;
      padding: 0 !important;
      margin: 0 !important;
    }

    .app-container,
    .navbar-wrapper,
    .floating-timer-fab,
    .toast-container,
    .modal-backdrop,
    .tab-view,
    .unified-panel,
    .card {
      display: none !important;
    }

    #printableReportArea {
      display: block !important;
      visibility: visible !important;
      position: absolute !important;
      left: 0 !important;
      top: 0 !important;
      width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
    }
  }

/* Efecto de Desactivado durante el Timer (Play) */
body.timer-running .navbar-wrapper,
body.timer-running .bottom-nav,
body.timer-running .tab-view:not(#tab-trabajar),
body.timer-running #workDetailsAccordionItem,
body.timer-running #workFoldedSummary {
  pointer-events: none !important;
  opacity: 0.5 !important;
  filter: grayscale(100%) !important;
  transition: all 0.3s ease;
}


/* ===== NAV: ICON-ONLY EN ESPACIO REDUCIDO ===== */
/* Cuando el nav-links tiene poco espacio, oculta el texto */
@media (max-width: 700px) {
  .nav-btn span {
    display: none;
  }
  .nav-btn {
    padding: 0.6rem 0.75rem;
    gap: 0;
    position: relative;
  }
}

/* Al hacer hover/focus, aparece el texto como tooltip flotante */
@media (max-width: 700px) {
  .nav-btn:hover span,
  .nav-btn:focus span,
  .nav-btn.active span {
    display: inline;
    position: absolute;
    bottom: -2.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    border: 1px solid var(--border-color);
  }
  .nav-links {
    position: relative;
    overflow: visible;
  }
  .navbar-wrapper {
    overflow: visible !important;
  }
}
