/* Portal Shared Styles */
:root {
  --bg: #f5f5f7;
  --bg-2: #fafafa;
  --surface: #ffffff;
  --surface-2: #f6f8ff;
  --border: #e5e7eb;
  --border-strong: #d1d1d6;
  --text: #1d1d1f;
  --muted: #86868b;
  --accent: #0071e3;
  --accent-2: #0077ed;
  --glow: rgba(0,113,227,0.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(120% 120% at 12% 8%, rgba(0,113,227,0.08), transparent 40%),
              radial-gradient(120% 120% at 90% 0%, rgba(52,199,89,0.08), transparent 38%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 28px;
  height: 28px;
}
.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}
.tenant-chip strong {
  color: var(--text);
  font-weight: 600;
}

/* Navigation */
.nav-section {
  flex: 1;
}
.nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 700;
  padding-left: 4px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(0,0,0,0.04);
}
.nav-item.active {
  background: #000;
  color: #fff;
}
.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

/* Main Area */
.main-area {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  max-width: 1200px;
}

/* Cards and Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Hero/Topbar */
.topbar {
  background: linear-gradient(135deg, rgba(0,113,227,0.08), rgba(0,113,227,0.02));
  border: 1px solid rgba(0,113,227,0.12);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.topbar .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.topbar h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar p {
  margin: 0;
  color: var(--muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  font-size: 1.1rem;
}
.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.stat-value {
  margin: 2px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Section blocks */
.section-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.section-block:last-child { margin-bottom: 0; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-heading h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.section-hint {
  padding: 6px 12px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Form elements */
.form-grid {
  display: grid;
  gap: 12px;
}
.input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

/* Tiles */
.tile {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.tile:last-child { margin-bottom: 0; }
.tile .title {
  font-weight: 600;
  margin-bottom: 4px;
}
.tile .meta {
  font-size: 0.875rem;
  color: var(--muted);
}
.tile .pill {
  display: inline-block;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

/* List tiles */
.list-tile {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}
.list-tile:last-child { margin-bottom: 0; }
.list-tile .title {
  font-weight: 600;
  margin-bottom: 4px;
}
.list-tile .meta {
  font-size: 0.875rem;
  color: var(--muted);
}
.list-tile .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Filters */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filters .btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}
.btn:hover {
  border-color: var(--border-strong);
}
.btn-primary {
  background: #000;
  color: #fff;
  border-color: #000;
}
.btn-primary:hover {
  background: #1d1d1f;
}
.btn-ghost {
  background: var(--surface-2);
}
.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Hours grid */
.hours-grid {
  display: grid;
  gap: 8px;
}
.hours-row {
  display: grid;
  grid-template-columns: 50px 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.hours-row label {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Service chips */
.service-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.875rem;
}
.service-chip:hover {
  border-color: var(--border-strong);
}

/* Calendar Styles */
.calendar-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.15s ease;
}
.calendar-nav-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.calendar-title {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}
.calendar-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.calendar-view-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--muted);
}
.calendar-view-btn:hover {
  color: var(--text);
}
.calendar-view-btn.active {
  background: #000;
  color: #fff;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.calendar-weekday {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-day {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}
.calendar-day:nth-child(7n) {
  border-right: none;
}
.calendar-day:hover {
  background: var(--surface-2);
}
.calendar-day.other-month {
  background: var(--bg);
  color: var(--muted);
}
.calendar-day.today {
  background: rgba(0,113,227,0.06);
}
.calendar-day.today .day-number {
  background: var(--accent);
  color: #fff;
}
.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 60px;
  overflow: hidden;
}
.day-event {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.day-event:hover {
  transform: scale(1.02);
}
.day-event.pending {
  background: #fef3c7;
  color: #92400e;
}
.day-event.confirmed {
  background: #dbeafe;
  color: #1e40af;
}
.day-event.completed {
  background: #dcfce7;
  color: #166534;
}
.day-event.cancelled {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
}
.day-more {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 2px 4px;
}

/* Week View */
.calendar-week-view {
  display: none;
}
.calendar-week-view.active {
  display: block;
}
.calendar-month-view {
  display: none;
}
.calendar-month-view.active {
  display: block;
}
.week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.week-header-cell {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.week-header-cell:last-child {
  border-right: none;
}
.week-header-cell .day-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.week-header-cell .day-num {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 4px;
}
.week-header-cell.today .day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.week-time-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  max-height: 500px;
  overflow-y: auto;
}
.week-time-label {
  padding: 8px 4px;
  text-align: right;
  font-size: 0.7rem;
  color: var(--muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  height: 50px;
}
.week-time-slot {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  height: 50px;
  padding: 2px;
  position: relative;
}
.week-time-slot:nth-child(8n) {
  border-right: none;
}
.week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  overflow: hidden;
  z-index: 1;
  cursor: pointer;
}
.week-event .event-time {
  font-weight: 400;
  opacity: 0.8;
}

/* Day View */
.calendar-day-view {
  display: none;
}
.calendar-day-view.active {
  display: block;
}
.day-view-header {
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.day-view-header .date-full {
  font-size: 1.25rem;
  font-weight: 600;
}
.day-view-header .date-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 4px;
}
.day-time-grid {
  max-height: 500px;
  overflow-y: auto;
}
.day-time-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.day-time-label {
  padding: 10px 8px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.day-time-content {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-event-card {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.day-event-card:hover {
  transform: translateX(4px);
}
.day-event-card .event-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.day-event-card .event-meta {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Calendar legend */
.calendar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend-dot.pending { background: #fef3c7; border: 1px solid #fcd34d; }
.legend-dot.confirmed { background: #dbeafe; border: 1px solid #93c5fd; }
.legend-dot.completed { background: #dcfce7; border: 1px solid #86efac; }
.legend-dot.cancelled { background: #fee2e2; border: 1px solid #fca5a5; }

/* Chip */
.chip {
  padding: 5px 10px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

/* Profile Hero */
.profile-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0,113,227,0.08), rgba(0,113,227,0.02));
  border: 1px solid rgba(0,113,227,0.12);
  border-radius: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-info .name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.profile-info .meta-line {
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-info .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.online {
  background: #dcfce7;
  color: #16a34a;
}
.status-badge.offline {
  background: var(--surface-2);
  color: var(--muted);
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-area {
    margin-left: 0;
    padding: 70px 16px 24px;
  }
  .calendar-header {
    flex-direction: column;
    gap: 12px;
  }
  .calendar-day {
    min-height: 80px;
    padding: 6px;
  }
  .day-number {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  .day-event {
    font-size: 0.6rem;
    padding: 2px 4px;
  }
  .week-time-grid {
    max-height: 400px;
  }
  .week-header {
    grid-template-columns: 40px repeat(7, 1fr);
  }
  .week-time-grid {
    grid-template-columns: 40px repeat(7, 1fr);
  }
  .week-header-cell .day-num {
    font-size: 1rem;
  }
  .week-time-label {
    font-size: 0.6rem;
  }
}
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .calendar-view-toggle {
    width: 100%;
  }
  .calendar-view-btn {
    flex: 1;
    padding: 8px 8px;
    font-size: 0.7rem;
  }
  .calendar-day {
    min-height: 60px;
    padding: 4px;
  }
  .day-events {
    max-height: 40px;
  }
  .calendar-legend {
    gap: 10px;
    justify-content: center;
  }
  .legend-item {
    font-size: 0.65rem;
  }
  .hours-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hours-row label {
    grid-column: 1 / -1;
  }
  .profile-hero {
    flex-direction: column;
    text-align: center;
  }
  .profile-info .meta-line {
    justify-content: center;
  }
  .profile-info .chips {
    justify-content: center;
  }
  .main-area {
    padding: 60px 12px 16px;
  }
  .topbar {
    padding: 16px;
  }
  .topbar h1 {
    font-size: 1.4rem;
  }
  .panel {
    padding: 14px;
    border-radius: 14px;
  }
  .section-block {
    padding: 14px;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .filters .btn {
    flex-shrink: 0;
  }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
  .main-area {
    padding: 56px 10px 12px;
  }
  .topbar {
    padding: 14px;
    margin-bottom: 14px;
  }
  .topbar h1 {
    font-size: 1.2rem;
    line-height: 1.3;
  }
  .topbar .eyebrow {
    font-size: 0.65rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-value {
    font-size: 1.2rem;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  .panel {
    padding: 12px;
    border-radius: 12px;
  }
  .section-block {
    padding: 12px;
    border-radius: 12px;
  }
  .section-heading h3 {
    font-size: 0.95rem;
  }
  .list-tile {
    padding: 12px;
  }
  .tile {
    padding: 12px;
  }
  .btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  .btn-sm {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
  .input {
    padding: 12px 14px;
    font-size: 16px; /* Prevent iOS zoom */
    border-radius: 10px;
  }
  .calendar-title {
    font-size: 0.95rem;
    min-width: 120px;
  }
  .calendar-nav-btn {
    width: 32px;
    height: 32px;
  }
  .sidebar-toggle {
    width: 40px;
    height: 40px;
    top: 12px;
    left: 12px;
    font-size: 1rem;
  }
  .service-chip {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  .user-chip {
    padding: 10px;
  }
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  .user-name {
    font-size: 0.8rem;
  }
}

/* Extra small mobile (380px) */
@media (max-width: 380px) {
  .main-area {
    padding: 52px 8px 10px;
  }
  .topbar h1 {
    font-size: 1.1rem;
  }
  .stat-value {
    font-size: 1.1rem;
  }
  .calendar-weekday {
    font-size: 0.6rem;
    padding: 8px 4px;
  }
  .calendar-day {
    min-height: 50px;
  }
  .day-number {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }
}

/* Touch-friendly targets */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
  .nav-item {
    min-height: 48px;
  }
  .input {
    min-height: 48px;
  }
  .sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }
  .calendar-nav-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .service-chip {
    min-height: 48px;
  }
  .list-tile {
    min-height: 60px;
  }
  .calendar-view-btn {
    min-height: 40px;
  }
}

/* Safe areas for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .main-area {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .sidebar {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }
  .sidebar-toggle {
    left: max(16px, env(safe-area-inset-left));
  }
}
