/* ============================================================
   ZILE LIBERE - Premium CSS
   Design: Liquid Glass / Apple-inspired
   ============================================================ */

/* ---- Design Tokens (Light Mode) ---- */
:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #e8eaf0;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-blur: blur(24px);
  --bg-card-border: rgba(255, 255, 255, 0.6);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  --text-accent: #0071e3;

  --accent-blue: #0071e3;
  --accent-blue-hover: #0062c5;
  --accent-blue-light: #e8f0fe;
  --accent-blue-dark: #003d82;
  --accent-green: #34c759;
  --accent-amber: #f59e0b;
  --accent-red: #ff3b30;

  --weekend-bg: rgba(0,0,0,0.025);
  --holiday-bg: #dbeafe;
  --holiday-text: #1e40af;
  --holiday-bg-strong: #bfdbfe;
  --vacation-border: #1e3a8a;
  --vacation-bg: #eff6ff;
  --suggestion-dot: #f59e0b;
  --today-ring: #0071e3;

  --shadow-card: 0 2px 16px rgba(0,0,0,0.07), 0 8px 32px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.13);
  --shadow-status: 0 -2px 20px rgba(0,0,0,0.06);

  --border-radius-card: 20px;
  --border-radius-day: 50%;

  --transition-fast: 0.15s ease;
  --transition-med: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.42s cubic-bezier(0.4, 0, 0.2, 1);

  --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;

  --header-height: 70px;
  --tabs-height: 52px;
  --status-height: auto;
  --status-min: 80px;

  --z-header: 100;
  --z-status: 100;
  --z-toast: 200;
  --z-tooltip: 150;
}

/* ---- Dark Mode Tokens ---- */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(22, 22, 30, 0.88);
  --bg-card-border: rgba(255, 255, 255, 0.07);

  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  --text-accent: #2997ff;

  --accent-blue: #2997ff;
  --accent-blue-hover: #1a87ef;
  --accent-blue-light: #1c3557;
  --accent-blue-dark: #0d2d56;

  --weekend-bg: rgba(255,255,255,0.025);
  --holiday-bg: #1c2f4a;
  --holiday-text: #93c5fd;
  --holiday-bg-strong: #1e3a5f;
  --vacation-border: #93c5fd;
  --vacation-bg: #0d2034;
  --suggestion-dot: #fbbf24;
  --today-ring: #2997ff;

  --shadow-card: 0 2px 16px rgba(0,0,0,0.35), 0 8px 32px rgba(0,0,0,0.28);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-status: 0 -2px 20px rgba(0,0,0,0.3);
  --bg-card-blur: blur(28px);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,113,227,0.4);
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--bg-card-blur);
  -webkit-backdrop-filter: var(--bg-card-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-card);
  transition: background var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-med);
}

.glass-card:hover {
  box-shadow: var(--shadow-hover);
}

/* ============================================================
   APP WRAPPER
   ============================================================ */
.app-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 12px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 8px;
  z-index: var(--z-header);
  padding: 0;
  border-radius: var(--border-radius-card);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 12px;
}

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

.logo-svg {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,113,227,0.3));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.app-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  background: linear-gradient(135deg, #0071e3 0%, #f5c542 50%, #e74c6f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background var(--transition-slow);
}

.app-subtitle {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.theme-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.theme-btn:hover {
  background: var(--accent-blue);
  color: white;
  transform: scale(1.08);
}

.theme-btn:active {
  transform: scale(0.95);
}

/* Year Scroller */
.year-scroller {
  position: relative;
  height: 78px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  min-width: 48px;
}

.year-scroller:active {
  cursor: grabbing;
}

.year-scroller-track {
  position: absolute;
  left: 0;
  right: 0;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.year-scroller-item {
  font-family: var(--font-primary);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: font-size 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.year-scroller-item--selected {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.year-scroller-item--adjacent {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ============================================================
   MONTH TABS
   ============================================================ */
.month-tabs-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius-card);
  scrollbar-width: none;
  position: sticky;
  top: calc(var(--header-h, 58px) + 16px);
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.month-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.month-tabs {
  display: flex;
  background: var(--bg-card);
  backdrop-filter: var(--bg-card-blur);
  -webkit-backdrop-filter: var(--bg-card-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-card);
  padding: 5px 6px;
  gap: 2px;
  min-width: max-content;
  box-shadow: var(--shadow-card);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.month-tab {
  flex: 1;
  min-width: 42px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.month-tab:hover {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.month-tab.active {
  background: var(--accent-blue);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,113,227,0.35);
}

/* ============================================================
   SWIPE CONTAINER
   ============================================================ */
.swipe-outer {
  overflow: hidden;
  border-radius: var(--border-radius-card);
  position: relative;
}

.swipe-container {
  display: flex;
  width: 300%;
  transform: translateX(-33.333%);
  transition: transform var(--transition-slow);
  will-change: transform;
}

.swipe-container.no-transition {
  transition: none;
}

.swipe-container.swiping {
  transition: none;
}

.month-panel {
  width: 33.333%;
  flex-shrink: 0;
}

/* ============================================================
   CALENDAR CARD
   ============================================================ */
.calendar-card {
  background: var(--bg-card);
  backdrop-filter: var(--bg-card-blur);
  -webkit-backdrop-filter: var(--bg-card-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: background var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-med);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

[data-theme="dark"] .calendar-header {
  border-bottom-color: rgba(255,255,255,0.04);
}

.calendar-month-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.calendar-month-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* Calendar Grid */
.calendar-body {
  padding: 10px 32px 14px;
  overflow: visible;
}

.calendar-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Weekday Headers */
.weekday-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.weekday-header {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 10px 2px 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.weekday-header.weekend-header {
  color: var(--accent-red);
  opacity: 0.7;
}

/* Days Grid */
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
}

/* Day Cell */
.day-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  min-height: 26px;
  min-width: 26px;
  color: var(--text-primary);
}

.day-cell:hover:not(.other-month):not(.weekend-day) {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  transform: scale(1.08);
}

.day-cell.weekend-day {
  background: var(--weekend-bg);
  color: var(--text-secondary);
  cursor: default;
}

.day-cell.other-month {
  color: var(--text-muted);
  opacity: 0.45;
  cursor: default;
}

.day-cell.other-month:hover {
  background: transparent;
  transform: none;
}

/* Holiday */
.day-cell.holiday {
  background: var(--holiday-bg);
  color: var(--holiday-text);
  font-weight: 700;
  cursor: default;
}

.day-cell.holiday:hover {
  background: var(--holiday-bg-strong);
  transform: scale(1.06);
}

/* Vacation Day (user selected) */
.day-cell.vacation {
  background: var(--vacation-bg);
  outline: 2.5px solid var(--vacation-border);
  outline-offset: -16px;
  color: var(--vacation-border);
  font-weight: 600;
}

.day-cell.vacation:hover {
  background: var(--accent-blue-light);
  outline-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Today indicator */
.day-cell.today {
  background: rgba(147, 51, 234, 0.08);
}

.day-cell.today .day-number {
  font-weight: 800;
  font-size: 1.05em;
  color: var(--accent-blue);
}

/* Suggestion dot indicator */
.day-cell.has-suggestion .day-dot {
  display: block;
}

.day-dot {
  display: none;
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--suggestion-dot);
  pointer-events: none;
}

/* Combined states */
.day-cell.holiday.vacation {
  background: var(--holiday-bg);
  outline: 2.5px solid var(--accent-blue-dark);
  color: var(--holiday-text);
}

/* Day Number */
.day-number {
  line-height: 1;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HOLIDAY TOOLTIP BADGE
   ============================================================ */
.holiday-name-badge {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.67rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 7px;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.day-cell:hover .holiday-name-badge {
  display: block;
}

/* ============================================================
   HOLIDAYS LIST SECTION
   ============================================================ */
.holidays-list-section {
  position: static;
  overflow: hidden;
  margin-top: 16px;
}

.holidays-list-icon {
  color: var(--accent-red);
}

.holiday-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--holiday-bg);
  border: 1px solid rgba(255, 59, 48, 0.12);
  border-radius: 14px;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .holiday-list-item {
  border-color: rgba(255, 69, 58, 0.15);
}

.holiday-list-date {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-red);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.holiday-list-date-day {
  font-size: 0.9rem;
  font-weight: 800;
}

.holiday-list-date-month {
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
}

.holiday-list-details {
  flex: 1;
  min-width: 0;
}

.holiday-list-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.holiday-list-weekday {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.no-holidays {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   SUGGESTIONS SECTION
   ============================================================ */
.suggestions-section {
  position: static;
  overflow: hidden;
  margin-top: 16px;
}

.suggestions-header {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-primary);
  transition: background var(--transition-fast);
  border-radius: var(--border-radius-card);
}

.suggestions-header:hover {
  background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .suggestions-header:hover {
  background: rgba(255,255,255,0.03);
}

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

.suggestions-icon {
  color: var(--accent-amber);
}

.suggestions-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.suggestions-badge {
  background: var(--accent-blue);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.collapse-arrow {
  color: var(--text-secondary);
  transition: transform var(--transition-med);
  flex-shrink: 0;
}

.suggestions-header[aria-expanded="false"] .collapse-arrow {
  transform: rotate(-90deg);
}

.suggestions-body {
  overflow: hidden;
  max-height: 600px;
  transition: max-height var(--transition-slow), opacity var(--transition-slow);
  opacity: 1;
}

.suggestions-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.suggestions-tabs {
  display: flex;
  gap: 6px;
  padding: 0 18px 12px;
}

.sugg-tab {
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.sugg-tab:hover {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

.sugg-tab.active {
  background: var(--accent-blue);
  color: white;
  font-weight: 600;
}

.suggestions-list {
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

/* Suggestion Item */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--accent-blue-light);
  border: 1px solid rgba(0,113,227,0.12);
  border-radius: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

[data-theme="dark"] .suggestion-item {
  border-color: rgba(41,151,255,0.15);
}

.suggestion-item:hover {
  background: rgba(0,113,227,0.1);
  border-color: rgba(0,113,227,0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,113,227,0.1);
}

.suggestion-score-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.suggestion-details {
  flex: 1;
  min-width: 0;
}

.suggestion-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.suggestion-apply-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--accent-blue);
  border-radius: 10px;
  background: transparent;
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.suggestion-apply-btn:hover {
  background: var(--accent-blue);
  color: white;
}

.suggestion-apply-btn.applied {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.no-suggestions {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   STATUS BAR
   ============================================================ */
.status-bar {
  position: sticky;
  bottom: 8px;
  z-index: var(--z-status);
  border-radius: var(--border-radius-card);
  padding: 12px 16px;
  box-shadow: var(--shadow-status), var(--shadow-card);
}

.status-grid {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px 0;
  align-items: center;
  justify-content: space-between;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.stat-value.accent {
  color: var(--accent-blue);
}

.stat-value.muted {
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-value.tva {
  font-weight: 700;
  color: #e74c6f;
}

[data-theme="dark"] .stat-value.tva {
  color: #f472b6;
}

.stat-value.total {
  font-weight: 700;
  color: #16a34a;
}

[data-theme="dark"] .stat-value.total {
  color: #4ade80;
}

/* Editable stat inputs */
.stat-editable {
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-input {
  width: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-primary);
  padding: 3px 5px;
  text-align: right;
  transition: all var(--transition-fast);
  outline: none;
  -moz-appearance: textfield;
}

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

.stat-input:focus {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
  width: 68px;
}

[data-theme="dark"] .stat-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f5f5f7;
}

[data-theme="dark"] .stat-input:focus {
  background: rgba(41, 151, 255, 0.18);
  border-color: var(--accent-blue);
}

.stat-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Company Toggle */
.company-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
  width: fit-content;
}

.company-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.company-btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 1px 4px rgba(0,113,227,0.3);
}

/* Currency Toggle (RON/EUR) */
.currency-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
  width: fit-content;
}

.currency-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.currency-btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 1px 4px rgba(0,113,227,0.3);
}

/* Undo Button (calendar header) */
.cal-undo-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.cal-undo-btn:not(:disabled):hover {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  transform: scale(1.08);
}

.cal-undo-btn:not(:disabled):active {
  transform: scale(0.95);
}

.cal-undo-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.cal-undo-wrap {
  display: inline-flex;
  cursor: default;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  pointer-events: auto;
  max-width: 320px;
  text-align: center;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  will-change: transform, opacity;
}

.toast.toast-out {
  animation: toast-out 0.25s ease forwards;
}

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.toast.success { }
.toast.info { }
.toast.warning {
  background: var(--accent-amber);
  color: white;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.88);
  }
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip {
  position: fixed;
  background: rgba(29,29,31,0.92);
  color: #f5f5f7;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  pointer-events: none;
  z-index: var(--z-tooltip);
  max-width: 200px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  display: none;
  white-space: nowrap;
}

.tooltip.visible {
  display: block;
}

/* ============================================================
   APP FOOTER LINKS
   ============================================================ */
.app-disclaimer {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 0;
  padding: 8px 12px 0;
}

.app-footer-links {
  text-align: center;
  padding: 6px 12px 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-footer-links a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.app-footer-links a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.footer-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.footer-copy {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 2px 12px 6px;
}

.footer-heart {
  color: #e74c6f;
}

/* ============================================================
   STATUS BAR MOBILE HINT
   ============================================================ */
.status-bar-hint {
  display: none;
}

@media (max-width: 640px) {
  .status-bar-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    right: 12px;
    background: rgba(29, 29, 31, 0.92);
    color: #f5f5f7;
    font-size: 0.73rem;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: hintSlideUp 0.4s ease forwards;
    z-index: 110;
  }

  .status-bar-hint.hidden {
    display: none;
  }

  .hint-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #f5f5f7;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 2px;
    line-height: 1;
  }

  .hint-dismiss:hover {
    opacity: 1;
  }
}

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

/* ============================================================
   PRIVACY TOOLTIP (input focus)
   ============================================================ */
.privacy-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(29, 29, 31, 0.94);
  color: #f5f5f7;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.45;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 120;
  pointer-events: auto;
  animation: hintSlideUp 0.3s ease forwards;
  white-space: normal;
}

.privacy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(29, 29, 31, 0.94);
}

.privacy-tooltip .hint-dismiss {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #f5f5f7;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}

.privacy-tooltip .hint-dismiss:hover {
  opacity: 1;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.5; }
  50%  { transform: scale(1.18); opacity: 0.2; }
  100% { transform: scale(1); opacity: 0.5; }
}

.calendar-card {
  animation: fadeIn 0.35s ease forwards;
}

.no-card-anim .calendar-card {
  animation: none;
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 640px) {
  .app-wrapper {
    padding: 8px 8px 100px;
    gap: 8px;
  }

  .header-inner {
    padding: 10px 14px;
  }

  .app-title {
    font-size: 1.15rem;
  }

  .app-subtitle {
    display: none;
  }

  .header-controls {
    gap: 16px;
  }

  .month-tab {
    font-size: 0.72rem;
    min-width: 38px;
    padding: 5px 6px;
  }

  .weekday-header {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 2px;
  }

  .days-grid {
    gap: 6px;
  }

  .calendar-body {
    padding: 6px 8px 10px;
  }

  .day-cell {
    font-size: 0.78rem;
    min-height: 36px;
    min-width: 36px;
  }

  .day-cell.vacation {
    outline-offset: 4px;
  }

  .day-cell:hover:not(.other-month):not(.weekend-day) {
    background: transparent;
    color: inherit;
    transform: none;
  }

  .day-cell:hover .holiday-name-badge,
  .day-cell.holiday:hover .holiday-name-badge {
    display: none !important;
  }

  .calendar-month-title {
    font-size: 1.05rem;
  }

  /* Status bar: 2 columns on mobile */
  .status-grid {
    grid-template-columns: auto auto;
    gap: 6px 0;
  }

  .stat-input {
    width: 45px;
    font-size: 0.8rem;
  }

  .stat-input:focus {
    width: 60px;
  }

  .status-bar {
    padding: 10px 12px;
  }

  .suggestions-section {
    border-radius: 16px;
  }
}

@media (max-width: 380px) {
  .status-grid {
    grid-template-columns: auto auto;
  }

  .days-grid {
    gap: 4px;
  }

  .calendar-body {
    padding: 4px 6px 8px;
  }

  .day-cell {
    font-size: 0.68rem;
    min-height: 30px;
    min-width: 30px;
  }
}

/* ============================================================
   TERMS / GDPR PAGE STYLES
   ============================================================ */
.page-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.page-header {
  margin-bottom: 32px;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: opacity var(--transition-fast);
}

.page-back:hover {
  opacity: 0.75;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-section {
  background: var(--bg-card);
  backdrop-filter: var(--bg-card-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.page-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.page-section p, .page-section li {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.page-section ul, .page-section ol {
  padding-left: 20px;
  margin: 8px 0;
}

.page-section li {
  margin-bottom: 4px;
}

.page-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   EXTRA STATES
   ============================================================ */
.day-cell.adding {
  animation: day-add 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.day-cell.removing {
  animation: day-remove 0.25s ease forwards;
}

@keyframes day-add {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes day-remove {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.5; }
}

/* Holiday legend dots in calendar header */
.legend-row {
  display: flex;
  gap: 12px;
  padding: 6px 20px 8px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.holiday { background: var(--accent-blue); }
.legend-dot.vacation { background: transparent; border: 2px solid var(--vacation-border); }
.legend-dot.suggestion { background: var(--suggestion-dot); }
.legend-dot.today { background: rgba(147, 51, 234, 0.45); }

/* ---- Screen-reader only (hidden visually, visible to crawlers) ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- SEO Content Section ---- */
.seo-content {
  max-width: 680px;
  margin: 24px auto 8px;
  padding: 20px 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
.seo-content h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.seo-content h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 14px;
  margin-bottom: 4px;
}
.seo-content p {
  margin-bottom: 6px;
}
.seo-content strong {
  color: var(--text-secondary);
  font-weight: 500;
}
