/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.logo-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  list-style: none;
  padding: 0 0.75rem;
  flex: 1;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover {
  background: var(--bg-card);
  color: var(--fg);
}

.nav-links li.active a {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.back-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--fg);
}

/* ===== MAIN CONTENT ===== */
.app-main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1100px;
  overflow-x: hidden;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: #00e07a;
  transform: translateY(-1px);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: none;
}

.btn-ghost:hover {
  color: var(--fg);
}

.btn-danger {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 77, 77, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: rgba(0, 255, 136, 0.2);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.4rem;
}

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

.stat-label {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 2.5rem;
}

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

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.section-header .section-title {
  margin-bottom: 0;
}

/* ===== BOOKING CARDS ===== */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.booking-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s;
}

.booking-card:hover {
  border-color: rgba(0, 255, 136, 0.2);
}

.booking-card.cancelled {
  opacity: 0.5;
}

.booking-time {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 80px;
  flex-shrink: 0;
}

.time-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.date-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.duration-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
}

.booking-info {
  flex: 1;
  min-width: 0;
}

.booking-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-client {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.booking-location {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 0.15rem;
}

.booking-meta {
  flex-shrink: 0;
}

.booking-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ===== CLIENT GRID ===== */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.client-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.client-card:hover {
  border-color: rgba(0, 255, 136, 0.3);
  transform: translateY(-1px);
}

.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.client-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.client-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.view-all-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
}

.empty-state.large {
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* ===== TABLE ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-name-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
}

.table-name-link:hover {
  color: var(--accent);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.action-group {
  display: flex;
  gap: 0.5rem;
}

.muted {
  color: var(--fg-muted);
}

/* ===== FORMS ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 640px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8a9a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.required {
  color: #ff4d4d;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 0.3rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.form-hint-link {
  color: var(--accent);
  text-decoration: none;
}

.form-hint-link:hover {
  text-decoration: underline;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
}

/* ===== ALERTS ===== */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff4d4d;
}

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-confirmed {
  background: rgba(0, 255, 136, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-pending {
  background: rgba(255, 215, 0, 0.12);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.status-completed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.status-cancelled {
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.2);
}

/* ===== DETAIL GRID ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--fg);
  font-weight: 500;
}

/* ===== NOTES ===== */
.notes-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.notes-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.notes-card p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ===== CLIENT HEADER ===== */
.client-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.client-header .page-sub span + span::before {
  content: ' · ';
}

/* ===== LINK ===== */
.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .app-main {
    padding: 1.25rem 1rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .booking-card {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .booking-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .client-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1.25rem;
  }
}
