/* Premium Modern CSS Stylesheet */

:root {
  /* Color Palette - Light Mode */
  --bg-app: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;
  --bg-table-header: #f1f5f9;
  --bg-table-row-hover: #f8fafc;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --success: #10b981; /* Emerald */
  --danger: #ef4444; /* Rose */
  --warning: #f59e0b; /* Amber */
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #6366f1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-premium: 0 20px 25px -5px rgba(99, 102, 241, 0.05), 0 8px 10px -6px rgba(99, 102, 241, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s ease;
  
  --backdrop-blur: 12px;
}

/* Dark Mode Palette overrides */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-input: #1f2937;
  --bg-table-header: #1f2937;
  --bg-table-row-hover: #1e293b;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  
  --primary: #818cf8; /* Light Indigo */
  --primary-hover: #6366f1;
  --primary-glow: rgba(129, 140, 248, 0.25);
  
  --border-color: #374151;
  --border-hover: #4b5563;
  --border-focus: #818cf8;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

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

body {
  background-color: var(--bg-app);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header styling */
.app-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Left block: logo + subtitle stacked */
.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  filter: drop-shadow(0 2px 8px var(--primary-glow));
  animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.app-header h1 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-top: 0;
}

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

.user-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
}

.user-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.logout-btn:hover {
  text-decoration: underline;
}

/* Clock Widget */
.clock-widget {
  position: relative;
}

.clock-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.clock-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-md);
  transform: translateY(-1px);
}

.clock-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.live-clock {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 20px var(--primary-glow);
}

.clock-tz-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Timezone Dropdown */
.tz-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 100;
  overflow: hidden;
  animation: dropdown-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tz-dropdown-title {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 16px 6px;
}

.tz-option {
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tz-option:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.tz-option.selected {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcuts-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--transition-normal);
}

.shortcuts-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle button {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.theme-toggle button:hover {
  border-color: var(--border-hover);
  color: var(--primary);
  transform: scale(1.05);
}

.sun-icon {
  display: none;
  width: 20px;
  height: 20px;
}

.moon-icon {
  display: block;
  width: 20px;
  height: 20px;
}

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

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

/* App Card styling */
.app-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: border-color var(--transition-slow), background-color var(--transition-slow);
  position: relative;
}

/* Skeleton loader */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: skeleton-fade-in 0.2s ease;
}

.skeleton-loader.hidden {
  display: none;
}

@keyframes skeleton-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--bg-table-header) 0%,
    var(--border-color) 50%,
    var(--bg-table-header) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.skeleton-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-field--wide {
  grid-column: span 1;
}

.skeleton-label {
  height: 14px;
  width: 40%;
}

.skeleton-input {
  height: 42px;
  width: 100%;
}

.skeleton-input--tall {
  height: 52px;
}

.skeleton-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-heading {
  height: 20px;
  width: 140px;
}

.skeleton-heading--sm {
  width: 180px;
}

.skeleton-subtext {
  height: 12px;
  width: 70%;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}

.skeleton-table-header {
  height: 16px;
  width: 100%;
}

.skeleton-table-row {
  height: 44px;
  width: 100%;
}

.skeleton-textarea {
  height: 88px;
  width: 100%;
}

.skeleton-dropzone {
  height: 150px;
  width: 100%;
  border-radius: var(--radius-md);
}

.app-content[hidden] {
  display: none !important;
}

/* Sections Styling */
h2 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.helper-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* Inputs & Labels */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Custom date picker */
.custom-date-picker {
  width: 100%;
}

.custom-date-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.custom-date-trigger:hover {
  border-color: var(--border-hover);
}

.custom-date-trigger:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.custom-date-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.custom-date-trigger:hover .custom-date-icon,
.custom-date-trigger:focus .custom-date-icon {
  color: var(--primary);
}

.custom-date-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-date-text.is-placeholder {
  color: var(--color-text-muted);
}

.custom-date-picker--table .custom-date-trigger {
  padding: 8px 10px;
  font-size: 0.85rem;
  min-width: 140px;
}

.custom-date-picker--table .custom-date-icon {
  width: 16px;
  height: 16px;
}

/* Calendar popover */
.calendar-popover {
  position: fixed;
  z-index: 1100;
  width: 280px;
  padding: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: dropdown-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-primary);
}

.calendar-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-day.has-report {
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--primary-glow);
  font-weight: 700;
}

.calendar-day.has-report.has-pdf::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  border: 1.5px solid var(--bg-card);
}

.calendar-day.has-report.is-selected {
  border-color: var(--primary);
}

.calendar-day.has-report.is-selected.has-pdf::after {
  border-color: var(--primary);
}

.calendar-day:hover:not(.calendar-day--empty) {
  background: var(--primary-glow);
  color: var(--primary);
}

.calendar-day.is-today {
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.calendar-day.is-selected {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.calendar-day.is-selected.is-today {
  border-color: var(--primary);
}

.calendar-day.is-weekend:not(.has-report):not(.is-selected) {
  color: var(--color-text-muted);
  opacity: 0.75;
}

.calendar-day.is-weekend:not(.has-report):hover {
  opacity: 1;
}

.calendar-day--empty {
  pointer-events: none;
}

.computed-field {
  background-color: var(--bg-table-header) !important;
  color: var(--primary) !important;
  font-weight: 600;
  cursor: default;
}

.computed-field:focus {
  box-shadow: none !important;
  border-color: var(--border-color) !important;
}

/* Meta Data section */
.meta-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.input-group--date-nav {
  min-width: 0;
}

.date-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.date-nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.btn-compact {
  padding: 8px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.date-nav-picker {
  flex: 1;
  min-width: 0;
}

.date-nav-picker .custom-date-picker,
.date-nav-picker .custom-date-trigger {
  width: 100%;
}

.btn-date-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.btn-date-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

.btn-date-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hours-meta-group {
  grid-column: span 1;
}

.hours-meta-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 6px;
}

.hours-meta-labels label {
  margin-bottom: 0;
  padding: 0 16px;
}

.hours-meta-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hours-meta-block {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  min-height: 41px;
}

.hours-meta-block--total {
  border-left: 1px solid var(--border-color);
  background: var(--primary-glow);
}

.hours-meta-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.hours-meta-value input {
  width: 56px;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  -moz-appearance: textfield;
}

.hours-meta-value input::-webkit-outer-spin-button,
.hours-meta-value input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hours-meta-value input:focus {
  box-shadow: none;
}

.hours-meta-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hours-meta-value--computed {
  color: var(--primary);
}

/* Time worked input (per task) */
.time-worked-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

.time-worked-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  flex: 1;
  min-width: 110px;
}

.time-worked-controls:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.time-worked-controls.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.time-hours-input,
.time-mins-input {
  width: 44px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.time-hours-input::-webkit-outer-spin-button,
.time-hours-input::-webkit-inner-spin-button,
.time-mins-input::-webkit-outer-spin-button,
.time-mins-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-unit {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: lowercase;
  user-select: none;
  flex-shrink: 0;
}

.time-all-day-chip {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-table-header);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.time-all-day-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.time-all-day-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Work section tabs */
.work-tabs {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.work-tabs-nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.work-tab-btn {
  position: relative;
  flex: 1 1 0;
  min-width: max-content;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.work-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-glow);
}

.work-tab-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.work-tab-label--short {
  display: none;
}

.work-tab-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  border: 1.5px solid var(--bg-input);
}

.work-tab-btn.is-active .work-tab-badge {
  border-color: var(--primary);
  background: #fff;
}

.work-tabs-panels {
  display: flex;
  flex-direction: column;
}

.work-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-tab-panel.hidden {
  display: none !important;
}

.section-intro {
  margin: 0;
}

.skeleton-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.skeleton-tab {
  height: 38px;
  flex: 1;
  border-radius: var(--radius-sm);
}

/* Tasks Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  background-color: var(--bg-input);
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tasks-table th {
  background-color: var(--bg-table-header);
  color: var(--color-text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.tasks-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

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

.tasks-table tbody tr:hover {
  background-color: var(--bg-table-row-hover);
}

.tasks-table tbody tr.is-dragging {
  opacity: 0.45;
}

.tasks-table tbody tr.is-drag-over td {
  box-shadow: inset 0 3px 0 var(--primary);
}

.tasks-table th.drag-col,
.tasks-table td.drag-cell {
  width: 36px;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: grab;
  border-radius: 4px;
  touch-action: none;
}

.drag-handle:hover {
  color: var(--primary);
  background-color: var(--bg-table-header);
}

.drag-handle:active {
  cursor: grabbing;
}

.tasks-mobile-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.task-mobile-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.task-mobile-card.is-dragging {
  opacity: 0.45;
}

.task-mobile-card.is-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.task-mobile-card-layout {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.task-mobile-card-layout .drag-handle {
  align-self: center;
  flex-shrink: 0;
}

.task-mobile-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-mobile-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.task-mobile-card-header .task-mobile-name {
  flex: 1;
  min-height: 44px;
}

.task-mobile-update {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--bg-card);
}

.task-mobile-update summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.task-mobile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.task-mobile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.task-mobile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

/* Editable cells textareas */
.table-textarea {
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  resize: vertical;
  padding: 4px;
  min-height: 40px;
  font-size: 0.9rem;
  border-radius: 4px;
  overflow-y: hidden;
}

.table-textarea:hover {
  border-color: var(--border-color);
  background: var(--bg-input);
}

.table-textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-input);
}

/* Action buttons in columns */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  gap: 8px;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background-color: var(--bg-input);
  border-color: var(--border-color);
  color: var(--color-text-secondary);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--color-text-primary);
  background-color: var(--bg-table-header);
}

.btn-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: transparent;
  padding: 6px;
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
}

.add-row-btn {
  flex: 1;
  border-style: dashed;
  border-width: 2px;
  padding: 12px;
  background-color: transparent;
}

.add-row-btn:hover {
  background-color: rgba(99, 102, 241, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.tasks-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

.task-copy-btn {
  flex: 0 0 auto;
  height: 100%;
  white-space: nowrap;
  border-style: dashed;
  border-width: 2px;
  padding: 12px 16px;
  background-color: transparent;
}

.task-copy-btn:hover {
  background-color: rgba(99, 102, 241, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 640px) {
  .tasks-actions {
    flex-direction: column;
  }
}

/* Additional updates section */
.updates-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.updates-section-header h2 {
  margin-bottom: 4px;
}

.updates-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.updates-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
}

.updates-view-btn {
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.updates-view-btn:hover {
  color: var(--primary);
  background: var(--primary-glow);
}

.updates-view-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.updates-panes {
  display: grid;
  gap: 12px;
}

.updates-panes[data-view="edit"] {
  grid-template-columns: 1fr;
}

.updates-panes[data-view="split"] {
  grid-template-columns: 1fr 1fr;
}

.updates-panes[data-view="preview"] {
  grid-template-columns: 1fr;
}

.updates-panes[data-view="edit"] .updates-preview-pane {
  display: none !important;
}

.updates-panes[data-view="preview"] #additional-updates {
  display: none;
}

.updates-preview-pane {
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 0.92rem;
  line-height: 1.55;
}

.updates-preview-pane h1,
.updates-preview-pane h2,
.updates-preview-pane h3,
.updates-preview-pane h4 {
  font-family: var(--font-title);
  margin: 0.75em 0 0.35em;
}

.updates-preview-pane h1:first-child,
.updates-preview-pane h2:first-child,
.updates-preview-pane h3:first-child,
.updates-preview-pane h4:first-child {
  margin-top: 0;
}

.updates-preview-pane table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75em 0;
  font-size: 0.85rem;
}

.updates-preview-pane th,
.updates-preview-pane td {
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  text-align: left;
}

.updates-preview-pane th {
  background: var(--bg-table-header);
}

.updates-preview-pane ul,
.updates-preview-pane ol {
  padding-left: 1.25rem;
  margin: 0.5em 0;
}

.updates-preview-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.template-btn.has-template {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-glow);
}

/* Textarea inside updates section */
.updates-section textarea {
  resize: vertical;
  min-height: 80px;
}

/* Screenshot Upload/Paste drag & drop zone */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background-color: rgba(0, 0, 0, 0.01);
  position: relative;
  min-height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.03);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--color-text-muted);
}

.drop-zone:hover .upload-icon {
  color: var(--primary);
}

.badge {
  font-size: 0.75rem;
  background-color: var(--bg-table-header);
  padding: 4px 8px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  color: var(--color-text-secondary);
}

.drop-zone-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.drop-zone-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.hidden {
  display: none !important;
}

/* Delete confirmation modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  animation: modal-slide-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-card--wide {
  max-width: 720px;
}

.template-modal-editor {
  width: 100%;
  min-height: 280px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--color-text-primary);
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
}

.template-modal-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-actions--spread {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.modal-actions-left,
.modal-actions-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.modal-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-danger-solid {
  background-color: var(--danger);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-danger-solid:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

/* Footer layout */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.status-indicator {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.action-buttons--export {
  justify-content: flex-end;
}

.action-buttons--export .btn-export-primary {
  min-width: 160px;
}

.shortcuts-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.shortcuts-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-table-header);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--color-text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  .app-card {
    padding: 20px;
  }
  .table-container {
    display: none;
  }
  .tasks-mobile-list {
    display: flex;
  }
  .task-mobile-meta {
    grid-template-columns: 1fr;
  }
  .updates-section-header {
    flex-direction: column;
  }
  .updates-header-actions {
    align-items: stretch;
    width: 100%;
  }
  .updates-view-toggle {
    width: 100%;
  }
  .updates-view-btn {
    flex: 1;
  }
  .updates-panes[data-view="split"] {
    grid-template-columns: 1fr;
  }
  .work-tab-label--full {
    display: none;
  }
  .work-tab-label--short {
    display: inline;
  }
  .work-tab-btn {
    font-size: 0.82rem;
    padding: 10px 10px;
  }
  .date-nav-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-compact {
    width: 100%;
    justify-content: center;
  }
  .app-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .action-buttons--export {
    flex-direction: column-reverse;
  }
  .action-buttons--export button {
    width: 100%;
  }
}
