/* Solvaro Design System */
/* Font Stack */
:root {
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Color Palette */
:root {
  --bg-color: #FDFBF7;
  --card-color: #FFFFFF;
  --accent-color: #F2764B;
  --secondary-color: #2A9D8F;
  --text-color: #2B2B33;
  --text-muted: #6E6E7A;
  --positive-color: #2A9D5C;
  --negative-color: #D64545;
  
  /* Booking block colors (rotated pastel tones) */
  --booking-color-0: #FFD9C4; /* Peach */
  --booking-color-1: #C9EBDF; /* Mint */
  --booking-color-2: #DCD6F2; /* Lavender */
  --booking-color-3: #C6E3F5; /* Sky */
  
  /* Border radius */
  --border-radius: 14px;
  --border-radius-large: 18px;
  
  /* Shadows */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-stack);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  padding: 0;
  margin: 0;
}

/* Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px; /* For bottom nav on mobile */
}

/* Mobile first - 390px */
@media (min-width: 768px) {
  #app {
    padding-bottom: 0;
  }
}

@media (min-width: 1024px) {
  #app {
    padding-left: 70px; /* For sidebar on desktop */
    flex-direction: row;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

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

.btn-danger {
  background-color: var(--negative-color);
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-color);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: var(--font-stack);
  font-size: 16px;
  background-color: var(--card-color);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(242, 118, 75, 0.2);
}

/* Toasts */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  max-width: 320px;
  box-shadow: var(--shadow);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  background-color: var(--positive-color);
}

.toast.error {
  background-color: var(--negative-color);
}

/* Card */
.card {
  background-color: var(--card-color);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

/* Layout Components */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation - Bottom Nav (Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: var(--card-color);
  border-top: 1px solid #eee;
  height: 60px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 0;
  width: 20%;
}

.bottom-nav a.active {
  color: var(--accent-color);
}

.bottom-nav svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Sidebar (Desktop) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 70px;
  background-color: var(--card-color);
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.sidebar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 16px 0;
  width: 100%;
  text-align: center;
}

.sidebar a.active {
  color: var(--accent-color);
  background-color: rgba(242, 118, 75, 0.1);
  border-radius: 8px;
}

.sidebar svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-color);
}

.sidebar .brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.sidebar .brand span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
  grid-template-rows: auto 1fr;
  gap: 8px;
  margin-bottom: 16px;
  min-height: calc(100vh - 220px);
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.calendar-day-cell {
  min-height: 110px;
  padding: 8px;
  border-radius: var(--border-radius);
  background-color: var(--card-color);
  box-shadow: var(--shadow);
  position: relative;
  overflow-y: auto;
}

.calendar-day-cell.calendar-selecting {
  background-color: rgba(242, 118, 75, 0.18);
}

.calendar-day-cell.calendar-selecting-strong {
  background-color: rgba(242, 118, 75, 0.4);
}

.calendar-day-cell.today {
  border: 2px solid var(--accent-color);
}

.calendar-day-cell.has-bookings {
  border: 1px solid #eee;
}

.calendar-day-cell.empty {
  background-color: transparent;
  box-shadow: none;
  min-height: 0;
}

.calendar-day-number {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  font-weight: 500;
}

.calendar-block {
  background-color: var(--booking-color-0);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.calendar-block:nth-child(1) {
  background-color: var(--booking-color-0);
}

.calendar-block:nth-child(2) {
  background-color: var(--booking-color-1);
}

.calendar-block:nth-child(3) {
  background-color: var(--booking-color-2);
}

.calendar-block:nth-child(4) {
  background-color: var(--booking-color-3);
}

.calendar-block:nth-child(n+5) {
  background-color: var(--booking-color-0);
}

.calendar-block-freie-plaetze {
  background-color: #E0E0E0;
  color: #6E6E7A;
  font-size: 11px;
  padding: 3px 6px;
  margin-top: 4px;
  border-radius: 4px;
  display: inline-block;
}

.calendar-block-full {
  background-color: #f0f0f0;
  color: #6E6E7A;
  font-weight: 500;
  font-size: 12px;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 6px;
  text-align: center;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-content {
  background-color: var(--card-color);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-large);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px;
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Dashboard KPI Cards */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background-color: var(--card-color);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.kpi-card-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-card-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-card-change {
  font-size: 12px;
  color: var(--positive-color);
}

.kpi-card-change.negative {
  color: var(--negative-color);
}

/* Apartments List */
.apartments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.apartment-card {
  background-color: var(--card-color);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.apartment-card:hover {
  transform: translateY(-4px);
}

.apartment-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.apartment-max-guests {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.apartment-address {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Booking List */
.booking-list {
  margin-bottom: 24px;
}

.booking-item {
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.booking-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.booking-item-title {
  font-weight: 600;
  margin: 0;
}

.booking-item-dates {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.booking-item-guests {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.booking-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Finance Table */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.finance-table th,
.finance-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.finance-table th {
  background-color: #f8f8f8;
  font-weight: 600;
  color: var(--text-muted);
}

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

.finance-table-cell-value {
  text-align: right;
}

.finance-table-cell-positive {
  color: var(--positive-color);
}

.finance-table-cell-negative {
  color: var(--negative-color);
}

/* Chart */
.chart-container {
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-bar {
  height: 30px;
  background-color: var(--accent-color);
  border-radius: 4px;
  margin-bottom: 8px;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-bar-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-weight: 500;
  font-size: 14px;
}

.chart-bar-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-weight: 500;
  font-size: 14px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--border-radius);
}

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

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  margin-bottom: 0;
}

.skeleton-card {
  height: 100px;
  margin-bottom: 16px;
}

/* KPI-Card als Aktions-Button (Jahresübersicht) */
.kpi-card-action {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Status-Badges (Verträge) */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

.badge-active {
  background-color: rgba(42, 157, 92, 0.12);
  color: var(--positive-color);
}

.badge-ended {
  background-color: rgba(110, 110, 122, 0.15);
  color: var(--text-muted);
}

/* Buchungs-Zeitstrahl */
.timeline {
  position: relative;
  margin-left: 8px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 38px;
  bottom: -14px;
  width: 2px;
  background-color: #eceae4;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-date {
  flex: 0 0 auto;
  width: 56px;
  text-align: center;
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 10px 6px;
  z-index: 1;
}

.timeline-date-day {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-color);
}

.timeline-date-month {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.timeline-body {
  flex: 1;
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

/* Responsive */
@media (max-width: 1023px) {
  .sidebar {
    display: none;
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 0 12px;
  }
  
  .kpi-cards {
    grid-template-columns: 1fr;
  }
  
  .apartments-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-grid {
    gap: 4px;
  }
  
  .calendar-day-cell {
    min-height: 60px;
    padding: 4px;
  }
  
  .calendar-day-number {
    font-size: 12px;
    top: 4px;
    right: 4px;
  }
  
  .calendar-block {
    font-size: 10px;
    padding: 4px 6px;
  }
  
  .calendar-block-freie-plaetze {
    font-size: 10px;
    padding: 2px 4px;
  }
  
  .calendar-block-full {
    font-size: 10px;
    padding: 4px 6px;
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
  
  .sidebar {
    display: flex;
  }
  
  .calendar-day-cell {
    min-height: 100px;
  }
  
  .calendar-block {
    font-size: 14px;
  }
}