/* Light theme (default) */
:root {
  --bg: #FEFBF7; /* figmaBackground - light beige */
  --panel: #FFFFFF;
  --card: #FFFFFF;
  --text: #363636; /* figmaPrimaryText */
  --muted: #505050; /* figmaSecondaryText */
  --brand: #F2781D; /* figmaOrange */
  --brand-2: #6BA9E2; /* figmaLightBlue */
  --accent: #F87945; /* figmaCoral */
  --accent-green: #79DA7F; /* figmaLightGreen */
  --accent-purple: #B291E8; /* figmaLightPurple */
  --danger: #FF5555; /* figmaRed */
  --success: #79DA7F;
  --warning: #FFC800;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --border: rgba(0,0,0,0.08);
  --border-light: #E0E0E0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f172a; /* slate-900 */
  --panel: #0b1224;
  --card: #111936;
  --text: #e5e7eb; /* gray-200 */
  --muted: #9aa3b2; /* gray-400 */
  --brand: #F2781D; /* Keep orange for brand consistency */
  --brand-2: #38bdf8; /* sky-400 */
  --accent: #f59e0b; /* amber-500 */
  --accent-green: #22c55e;
  --accent-purple: #B291E8;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-hover: 0 15px 40px rgba(0,0,0,.5);
  --border: rgba(255,255,255,.08);
  --border-light: rgba(255,255,255,.12);
}

/* System theme detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f172a;
    --panel: #0b1224;
    --card: #111936;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --shadow-hover: 0 15px 40px rgba(0,0,0,.5);
    --border: rgba(255,255,255,.08);
    --border-light: rgba(255,255,255,.12);
  }
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, var(--bg), #0b132a 50%, var(--panel));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) body {
    background: linear-gradient(180deg, var(--bg), #0b132a 50%, var(--panel));
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  overflow-x: hidden;
}

/* Make container full-width when it contains calendar screen */
.container:has(#calendarScreen:not(.hidden)) {
  max-width: 100%;
  padding: 0;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: rgba(254, 251, 247, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  padding: 16px 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .header {
  background: rgba(10, 16, 35, .9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .header {
    background: rgba(10, 16, 35, .9);
  }
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  opacity: 0.8;
  transition: all 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
}

.nav-btn:hover, .nav-btn.active {
  background: rgba(255, 255, 255, .1);
  opacity: 1;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Theme Switcher */
.theme-switcher {
  position: relative;
  display: inline-block;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background: var(--border);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 10000;
}

.theme-menu.active {
  display: flex;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}

.theme-option:hover {
  background: var(--border);
}

.theme-option input[type="radio"] {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Lottie Animation Container */
.remy-animation {
  width: 100%;
  max-width: 200px;
  height: 200px;
  margin: 0 auto;
}

/* Small Remy for calendar sidebar */
.remy-animation-small {
  width: 100%;
  max-width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}

/* Floating Remy for pages without sidebar */
.remy-floating {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 80px;
  height: 80px;
  z-index: 40;
  pointer-events: none;
  opacity: 0.9;
}

.remy-floating lottie-player {
  width: 100%;
  height: 100%;
}

/* Hide floating Remy on mobile to avoid clutter */
@media (max-width: 768px) {
  .remy-floating {
    display: none;
  }
}

lottie-player {
  width: 100%;
  height: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Main Content */
.main {
  padding: 32px 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: calc(100vh - 80px);
  position: relative;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 100%;
  }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

[data-theme="dark"] .card {
  background: linear-gradient(180deg, var(--card), #0c1430);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .card {
    background: linear-gradient(180deg, var(--card), #0c1430);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

/* Auth Screen */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-label {
  font-weight: 600;
  font-size: 14px;
}

.form-input {
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s;
}

[data-theme="dark"] .form-input {
  background: rgba(255, 255, 255, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .form-input {
    background: rgba(255, 255, 255, .05);
  }
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(242, 120, 29, .1);
  background: var(--card);
}

/* Select dropdown styling for better contrast */
select.form-input {
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

[data-theme="dark"] select.form-input {
  background: rgba(255, 255, 255, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) select.form-input {
    background: rgba(255, 255, 255, .05);
  }
}

select.form-input option {
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
}

select.form-input option:hover {
  background: var(--border);
}

select.form-input option:checked {
  background: var(--brand);
  color: #FFFFFF;
  font-weight: 600;
}

/* Todo List */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Filter Buttons */
.filter-container {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--bg);
}

.filter-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.todo-item:hover {
  background: rgba(255, 255, 255, .06);
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.todo-checkbox.checked {
  background: #79DA7F;
  border-color: #79DA7F;
}

.todo-checkbox.checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-weight: bold;
  font-size: 12px;
}

.todo-content {
  flex: 1;
}

.todo-title {
  font-weight: 600;
  margin: 0 0 4px 0;
}

.todo-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Priority Badge Styling */
.priority-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.priority-high {
  background: #FF5555;
}

.priority-medium {
  background: #F2781D;
}

.priority-low {
  background: #6BA9E2;
}

/* Priority-based card backgrounds */
.todo-item.priority-high {
  background: rgba(255, 85, 85, 0.15);
}

.todo-item.priority-medium {
  background: rgba(255, 243, 205, 0.6);
}

.todo-item.priority-low {
  background: rgba(107, 169, 226, 0.15);
}

.todo-item.priority-none {
  background: var(--card);
}

.todo-item.completed {
  background: rgba(121, 218, 127, 0.15) !important;
}

/* Dark theme priority backgrounds */
[data-theme="dark"] .todo-item.priority-high {
  background: rgba(255, 85, 85, 0.2);
}

[data-theme="dark"] .todo-item.priority-medium {
  background: rgba(255, 193, 7, 0.2);
}

[data-theme="dark"] .todo-item.priority-low {
  background: rgba(107, 169, 226, 0.2);
}

[data-theme="dark"] .todo-item.priority-none {
  background: var(--card);
}

[data-theme="dark"] .todo-item.completed {
  background: rgba(121, 218, 127, 0.2) !important;
}

/* System dark theme priority backgrounds */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .todo-item.priority-high {
    background: rgba(255, 85, 85, 0.2);
  }

  :root:not([data-theme]) .todo-item.priority-medium {
    background: rgba(255, 193, 7, 0.2);
  }

  :root:not([data-theme]) .todo-item.priority-low {
    background: rgba(107, 169, 226, 0.2);
  }

  :root:not([data-theme]) .todo-item.priority-none {
    background: var(--card);
  }

  :root:not([data-theme]) .todo-item.completed {
    background: rgba(121, 218, 127, 0.2) !important;
  }
}

.todo-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.stat-card {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Companion List */
.companion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.companion-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, .05);
}

.companion-item .avatar {
  transition: transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.companion-item:hover .avatar {
  transform: scale(1.05);
}

.companion-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.companion-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  transition: color 0.3s ease;
}

.companion-role {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.companion-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-pending {
  background: rgba(245, 158, 11, .2);
  color: #fbbf24;
}

.status-accepted {
  background: rgba(16, 185, 129, .2);
  color: #34d399;
}

.status-rejected {
  background: rgba(239, 68, 68, .2);
  color: #f87171;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* Responsive */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
}

/* Hidden by default */
.hidden {
  display: none !important;
}

/* Error/Success Messages */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.message-error {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #f87171;
}

.message-success {
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #34d399;
}

/* Auth Tab Styles */
.auth-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.auth-tab.active {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
}

.auth-tab:hover:not(.active) {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

/* Password Toggle Styles */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .1);
}

/* Link Button Styles */
.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  padding: 0;
  transition: all 0.2s;
}

.btn-link:hover {
  color: #86efac;
}

/* Avatar Styles */
.avatar {
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile Picture Preview Styles */
#profilePicturePreview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}

/* Ensure the preview container maintains proper aspect ratio */
#profilePicturePreview {
  position: relative;
  overflow: hidden;
}

.avatar-fallback {
  color: var(--text);
  font-weight: 600;
  font-size: 0.6em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 24px;
}

/* Custom Dropdown Styles */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.custom-dropdown-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  min-width: 150px;
  transition: all 0.2s;
}

.custom-dropdown-button:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--brand);
}

.custom-dropdown-button.open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .1);
}

.custom-dropdown-arrow {
  margin-left: auto;
  transition: transform 0.2s;
}

.custom-dropdown-button.open .custom-dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
  white-space: nowrap;
}

.custom-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}

.custom-dropdown-option:hover {
  background: rgba(255, 255, 255, .1);
}

.custom-dropdown-option.selected {
  background: rgba(34, 197, 94, .1);
  color: var(--brand);
}

.custom-dropdown-option-name {
  flex: 1;
}

.custom-dropdown-option-email {
  font-size: 12px;
  color: var(--muted);
}

/* Calendar Styles */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 0 20px;
}

.calendar-month-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px;
}

.calendar-day-header {
  background: var(--panel);
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}

.calendar-day {
  background: var(--card);
  min-height: 100px;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-day:hover {
  background: var(--panel);
}

.calendar-day.today {
  background: var(--primary);
  color: white;
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day-number {
  font-weight: 600;
  margin-bottom: 4px;
}

.calendar-event {
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  font-weight: 500;
}

.calendar-event:hover {
  opacity: 0.8;
}

.event-user-indicator {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid white;
}

.events-list {
  margin: 20px;
  padding: 20px;
  background: var(--panel);
  border-radius: 8px;
}

.events-list h4 {
  margin: 0 0 16px 0;
  color: var(--text);
}

.event-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.event-item:hover {
  background: var(--panel);
}

.event-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
}

.event-content {
  flex: 1;
}

.event-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.event-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.event-time {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

/* Calendar Layout Styles */
.calendar-view-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-toggle-buttons {
  display: flex;
  gap: 4px;
}

.view-btn {
  padding: 6px 12px;
  font-size: 13px;
}

/* Calendar Screen - Full Width Layout */
#calendarScreen {
  width: 100%;
  max-width: 100%;
  padding-left: clamp(16px, 2vw, 48px);
  padding-right: clamp(16px, 2vw, 48px);
  box-sizing: border-box;
}

#calendarScreen .card {
  max-width: 100%;
  padding: 24px;
}

/* Responsive adjustments for calendar */
@media (max-width: 1024px) {
  #calendarScreen {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .calendar-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .calendar-layout {
    flex-direction: column;
  }
  
  .calendar-sidebar {
    width: 100%;
  }
}

.calendar-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.calendar-sidebar {
  width: 220px;
  flex-shrink: 0;
}

.calendar-main {
  flex: 1;
  min-width: 0;
}

/* Mini Calendar Styles */
.mini-calendar-container {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

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

.mini-calendar-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

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

.mini-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
}

.mini-calendar-day:hover {
  background: var(--panel);
}

.mini-calendar-day.today {
  background: var(--brand);
  color: white;
  font-weight: 600;
}

.mini-calendar-day.has-events::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.mini-calendar-day.selected {
  background: var(--brand-2);
  color: white;
}

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

/* My Calendars Styles */
.my-calendars {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
}

.my-calendars h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.calendar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}

.calendar-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
}

.calendar-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-picker-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0;
  flex-shrink: 0;
}

.calendar-item:hover .color-picker-btn {
  opacity: 1;
}

.color-picker-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* Color Picker Modal Styles */
.color-picker-content {
  padding: 20px 0;
}

.color-picker-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--panel);
  border-radius: 8px;
}

.color-preview-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: var(--text);
}

.color-option.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

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

/* Calendar Views Styles */
.calendar-views-container {
  margin-top: 20px;
}

.calendar-view {
  min-height: 500px;
}

/* Week View Styles */
.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.week-time-column {
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.week-time-slot {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.week-day-column {
  border-right: 1px solid var(--border);
  position: relative;
}

.week-day-header {
  background: var(--panel);
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.week-day-content {
  position: relative;
  min-height: 960px; /* 24 hours * 40px */
}

.week-event {
  position: absolute;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  border-left: 3px solid var(--brand);
}

.week-event:hover {
  opacity: 0.8;
}

/* Day View Styles */
.day-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-time-column {
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.day-time-slot {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.day-content {
  position: relative;
  min-height: 960px;
}

.day-event {
  position: absolute;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  border-left: 3px solid var(--brand);
  width: calc(100% - 8px);
  margin: 0 4px;
}

.day-event:hover {
  opacity: 0.8;
}

/* Agenda View Styles */
.agenda-list {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

.agenda-date-group {
  border-bottom: 1px solid var(--border);
}

.agenda-date-header {
  background: var(--panel);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.agenda-event {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 8px;
  margin-bottom: 4px;
}

.agenda-event:hover {
  opacity: 0.9;
}

.agenda-event:last-child {
  border-bottom: none;
}

.agenda-event-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agenda-event-time {
  font-size: 12px;
  color: white;
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
}

.agenda-event-details {
  flex: 1;
}

.agenda-event-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: white;
}

.agenda-event-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* Event Detail Modal Styles */
.event-detail-modal {
  max-height: 80vh;
  overflow-y: auto;
}

.event-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.event-detail-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.event-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-detail-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.event-detail-actions {
  display: flex;
  gap: 8px;
}

.event-detail-body {
  padding-top: 16px;
}

.event-detail-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.event-detail-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.event-detail-content {
  flex: 1;
}

.event-detail-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.event-detail-value {
  font-size: 14px;
  color: var(--text);
}

/* Responsive Design */
@media (max-width: 768px) {
  .calendar-layout {
    flex-direction: column;
    gap: 16px;
  }

  .calendar-sidebar {
    width: 100%;
  }

  .view-toggle-buttons {
    flex-wrap: wrap;
  }

  .week-grid,
  .day-grid {
    grid-template-columns: 50px 1fr;
  }

  .week-time-slot,
  .day-time-slot {
    height: 30px;
    font-size: 11px;
  }

  .week-day-content,
  .day-content {
    min-height: 720px; /* 24 hours * 30px */
  }
}

/* Utility classes for extracted inline styles */
.companion-mode-indicator {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-icon { color: var(--brand); font-size: 14px; }
.brand-text { font-size: 12px; color: var(--brand); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.subscription-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
}
.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.dropdown-arrow { font-size: 12px; transition: transform 0.2s; }
.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 10000;
}
.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.dropdown-item:last-child { border-bottom: none; }

/* Form utility classes */
.form-input-readonly {
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
}
.form-helper-text {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

/* Text and color utilities */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Margin utilities */
.margin-bottom-24 { margin-bottom: 24px; }
.margin-bottom-16 { margin-bottom: 16px; }
.margin-bottom-12 { margin-bottom: 12px; }
.margin-bottom-8 { margin-bottom: 8px; }
.margin-bottom-4 { margin-bottom: 4px; }
.margin-top-24 { margin-top: 24px; }
.margin-top-16 { margin-top: 16px; }
.margin-top-12 { margin-top: 12px; }
.margin-top-8 { margin-top: 8px; }
.margin-top-4 { margin-top: 4px; }
.margin-0 { margin: 0; }
.margin-4-0 { margin: 4px 0; }
.margin-8-0 { margin: 8px 0; }
.margin-12-0 { margin: 12px 0; }
.margin-16-0 { margin: 16px 0; }
.margin-24-0 { margin: 24px 0; }

/* Padding utilities */
.padding-0 { padding: 0; }
.padding-4 { padding: 4px; }
.padding-8 { padding: 8px; }
.padding-12 { padding: 12px; }
.padding-16 { padding: 16px; }
.padding-24 { padding: 24px; }
.padding-4-0 { padding: 4px 0; }
.padding-8-0 { padding: 8px 0; }
.padding-12-0 { padding: 12px 0; }
.padding-16-0 { padding: 16px 0; }
.padding-24-0 { padding: 24px 0; }

/* Font size utilities */
.font-size-12 { font-size: 12px; }
.font-size-14 { font-size: 14px; }
.font-size-16 { font-size: 16px; }
.font-size-18 { font-size: 18px; }
.font-size-20 { font-size: 20px; }
.font-size-24 { font-size: 24px; }

/* Font weight utilities */
.font-weight-400 { font-weight: 400; }
.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }
.font-weight-700 { font-weight: 700; }

/* Display utilities */
.display-flex { display: flex; }
.display-block { display: block; }
.display-inline-block { display: inline-block; }
.display-none { display: none; }
.display-grid { display: grid; }

/* Flex utilities */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }

/* Gap utilities */
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Width utilities */
.width-100 { width: 100%; }
.width-50 { width: 50%; }
.width-25 { width: 25%; }
.width-auto { width: auto; }

/* Height utilities */
.height-100 { height: 100%; }
.height-auto { height: auto; }

/* Position utilities */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Border utilities */
.border-none { border: none; }
.border-1 { border: 1px solid; }
.border-radius-4 { border-radius: 4px; }
.border-radius-8 { border-radius: 8px; }
.border-radius-12 { border-radius: 12px; }

/* Background utilities */
.bg-transparent { background: transparent; }
.bg-white { background: white; }
.bg-black { background: black; }

/* Opacity utilities */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.opacity-100 { opacity: 1; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-visible { overflow: visible; }

/* Z-index utilities */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Additional utility classes */
.gap-0 { gap: 0; }
.margin-bottom-20 { margin-bottom: 20px; }
.bg-opacity-5 { background: rgba(255, 255, 255, .05); }
.text-decoration-none { text-decoration: none; }
.brand-highlight { color: var(--brand); }
.margin-top-12 { margin-top: 12px; }
.margin-20-0 { margin: 20px 0; }
.margin-0-16 { margin: 0 16px; }
.flex-1 { flex: 1; }
.height-1 { height: 1px; }
.bg-opacity-20 { background: rgba(255, 255, 255, .2); }

/* Patient info banner */
.patient-info-banner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}
.gap-12 { gap: 12px; }
.margin-4-0 { margin: 4px 0 0 0; }
.text-primary { color: var(--text); }
.min-width-180 { min-width: 180px; }
.gap-8 { gap: 8px; }
.min-width-150 { min-width: 150px; }
.margin-left-8 { margin-left: 8px; }

/* Badge styles */
.badge-small {
  margin-left: 6px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}
.gap-12 { gap: 12px; }
.font-size-18 { font-size: 18px; }

/* Modal styles */
.modal-overlay {
  max-width: 100vw;
  overflow-x: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  width: 100%;
  max-width: 400px;
  margin: 24px;
}
.modal-card-large {
  width: 100%;
  max-width: min(500px, calc(100vw - 48px));
  margin: 24px;
  overflow-x: auto;
  box-sizing: border-box;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subscription modal styles */
.subscription-feature-box {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.font-size-32 { font-size: 32px; }
.margin-0-0-8-0 { margin: 0 0 8px 0; }
.font-size-24 { font-size: 24px; }
.font-size-16 { font-size: 16px; }

/* Subscription pricing box */
.subscription-pricing-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.font-size-36 { font-size: 36px; }
.font-size-14 { font-size: 14px; }
.margin-0-0-12-0 { margin: 0 0 12px 0; }
.text-left { text-align: left; }
.max-width-300 { max-width: 300px; }
.margin-0-auto { margin: 0 auto; }
.margin-bottom-8 { margin-bottom: 8px; }
.flex-1 { flex: 1; }
.margin-top-2 { margin-top: 2px; }
.padding-20 { padding: 20px; }
.pointer-events-none { pointer-events: none; }
.opacity-50 { opacity: 0.5; }

/* Profile picture preview */
.profile-picture-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gap-16 { gap: 16px; }
