:root {
  color-scheme: light;
  font-family: var(--font-main);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
}

.dossier-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.5rem, 2vw, 3rem);
}

.card {
  width: min(480px, 100%);
  background: var(--color-bg-card);
  padding: clamp(1.5rem, 2vw, 2.5rem);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.card.shared-visits-container {
  width: min(1400px, 100%);
  max-width: 100%;
}

.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2vw, 2rem);
  color: var(--color-primary);
}

.muted {
  color: var(--color-text-muted);
  margin-top: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.field span {
  font-weight: 600;
  color: var(--color-primary);
}

input[type="text"],
input[type="password"] {
  appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--color-bg-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--color-text-main);
}

input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.primary {
  width: 100%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button);
}

button.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: var(--color-secondary);
  color: var(--color-primary);
  border: 1px solid var(--color-border-light);
}

button.link {
  background: transparent;
  color: var(--color-accent);
  padding: 0;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.alert {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-weight: 500;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.dashboard {
  width: min(1024px, 100%);
  background: var(--color-bg-card);
  border-radius: 24px;
  padding: clamp(1.5rem, 2vw, 2.75rem);
  box-shadow: var(--shadow-dashboard);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.patient-selector {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.patient-select-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
}

.patient-select-dropdown {
  appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--color-bg-input);
  color: var(--color-text-main);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2324417c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  min-width: 200px;
}

.patient-select-dropdown:hover {
  border-color: var(--color-accent);
}

.patient-select-dropdown:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.layout {
  display: grid;
  gap: 1.5rem;
}

/* Mobile Navigation Styles */
.mobile-nav-header {
  display: none;
  margin-bottom: 1.5rem;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1rem;
  padding: 0.5rem 0;
}

.back-button:hover {
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .mobile-nav-header {
    display: block;
  }

  /* Default mobile view: Show list, hide details */
  .layout .content {
    display: none;
  }

  .layout .sidebar {
    display: flex;
  }

  /* Detail mobile view: Hide list, show details */
  .layout.mobile-detail-view .sidebar {
    display: none;
  }

  .layout.mobile-detail-view .content {
    display: flex;
  }
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(260px, 320px) 1fr;
  }
}

.sidebar {
  background: var(--color-secondary);
  padding: 1.25rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--color-border-light);
}

.sidebar h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-primary);
}

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

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}

.select-all-label input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
}

.select-all-label span {
  user-select: none;
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1.5;
}

#share-visits-button {
  width: auto !important;
  flex-shrink: 0;
  white-space: nowrap;
}

.visit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.visit-item {
  width: 100%;
  background: var(--color-bg-card);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  border: 1px solid transparent;
  text-align: left;
  box-shadow: 0 2px 4px rgba(36, 65, 124, 0.05);
}

.visit-item .visit-date {
  font-weight: 600;
  color: var(--color-primary);
}

.visit-item .visit-doctor {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.visit-item.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(58, 93, 165, 0.15);
}

.visit-item.loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.visit-item.loading .spinner {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.visit-details {
  background: var(--color-bg-card);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 16px 30px rgba(36, 65, 124, 0.08);
  border: 1px solid #f1f5f9;
}

.visit-details h2 {
  margin-top: 0;
  color: var(--color-primary);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.details-grid dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.details-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-main);
}

.document-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.document-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-secondary);
  border-radius: 14px;
  border: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}

/* Mobile responsive styles for document entries */
@media (max-width: 480px) {
  .document-entry {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .document-entry > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: stretch;
  }

  .document-entry .btn-view,
  .document-entry .secondary {
    flex: 1;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }
}

.document-name {
  font-weight: 600;
  color: var(--color-primary);
}

.document-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.download-all-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed #cbd5e1;
}

.download-all-entry {
  background: linear-gradient(135deg, var(--color-secondary), #ffffff);
  border: 2px solid var(--color-border-light);
}

.download-all-label {
  font-weight: 700;
  color: var(--color-primary);
}

.download-all-entry button.primary {
  width: auto;
  padding: 0.65rem 1.75rem;
}

@media (max-width: 480px) {
  .download-all-entry button.primary {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Skeleton Loader */
.skeleton {
  background: #f0f2f5;
  background: linear-gradient(90deg, #f0f2f5 25%, #e6e8eb 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-block {
  border-radius: 8px;
}

.skeleton-dashboard {
  pointer-events: none;
}

.skeleton-item {
  height: 80px;
  width: 100%;
  margin-bottom: 1rem;
}

.skeleton-details-header {
  height: 40px;
  width: 60%;
  margin-bottom: 2rem;
}

.skeleton-grid-item {
  height: 60px;
  width: 100%;
}

.password-requirements {
  background: #eff6ff;
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.small-text {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.requirements-list {
  list-style-type: disc;
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
  color: #374151;
}

.requirements-list li {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

button.loading {
  opacity: 0.7;
  cursor: wait;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* Medical Files Grid */
.medical-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.medical-file-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.medical-file-card:hover {
  box-shadow: 0 8px 16px rgba(36, 65, 124, 0.1);
  transform: translateY(-2px);
}

.file-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-secondary), #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

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

.file-name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.file-device {
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.file-date {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-view,
.btn-download,
.btn-close {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-view {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.btn-view:hover {
  background: var(--color-primary);
  transform: translateY(-1px);
}

.btn-view svg,
.btn-download svg,
.btn-close svg {
  width: 16px;
  height: 16px;
}

.btn-download {
  background: var(--color-success);
  color: var(--color-text-inverse);
}

.btn-download:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-close {
  background: var(--color-error);
  color: var(--color-text-inverse);
  padding: 0.75rem;
}

.btn-close:hover {
  background: #dc2626;
}

/* Media Viewer Modal */
.media-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.media-viewer-modal {
  background: white;
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.media-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  gap: 1rem;
}

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

.media-viewer-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Mobile responsive styles for media viewer */
@media (max-width: 640px) {
  .media-viewer-overlay {
    padding: 0;
  }

  .media-viewer-modal {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .media-viewer-header {
    padding: 1rem;
    gap: 0.5rem;
  }

  .media-viewer-info h3 {
    font-size: 0.95rem;
  }

  .media-viewer-meta {
    font-size: 0.75rem;
  }

  .media-viewer-actions {
    gap: 0.25rem;
  }

  /* Make download button icon-only on mobile */
  .media-viewer-actions .btn-download {
    padding: 0.65rem;
    font-size: 0;
  }

  .media-viewer-actions .btn-download svg {
    font-size: initial;
    width: 18px;
    height: 18px;
  }

  .btn-download,
  .btn-close {
    padding: 0.65rem;
  }

  .btn-download svg,
  .btn-close svg {
    width: 18px;
    height: 18px;
  }
}

/* Landscape mobile - overlay header on video */
@media (max-height: 500px) and (orientation: landscape) {
  .media-viewer-overlay {
    padding: 0;
  }

  .media-viewer-modal {
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .media-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .media-viewer-info h3 {
    font-size: 0.9rem;
    color: white;
    margin: 0;
  }

  .media-viewer-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
  }

  .media-viewer-body {
    flex: 1 1 100%;
    height: 100%;
    padding: 0;
  }

  .media-viewer-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
  }

  /* Hide button text, show only icons in landscape */
  .btn-download {
    background: rgba(16, 185, 129, 0.9);
    padding: 0.5rem;
    font-size: 0;
  }

  .btn-download svg {
    width: 20px;
    height: 20px;
  }

  .btn-close {
    background: rgba(239, 68, 68, 0.9);
    padding: 0.5rem;
  }

  .btn-close svg {
    width: 20px;
    height: 20px;
  }
}

.media-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
  overflow: hidden;
}

.media-viewer-content {
  max-width: 100%;
  width: 100%;
  object-fit: contain;
}

/* Desktop: constrain height to account for header */
@media (min-width: 641px) and (min-height: 501px) {
  .media-viewer-content {
    max-height: calc(90vh - 100px);
  }
}

/* Mobile portrait and landscape: use full height */
@media (max-width: 640px),
(max-height: 500px) {
  .media-viewer-content {
    max-height: 100%;
    height: 100%;
  }
}

/* Ensure video controls are always visible */
video.media-viewer-content {
  /* Force controls to stay visible and interactive */
  pointer-events: auto;
  /* Ensure controls have space at the bottom */
  padding-bottom: env(safe-area-inset-bottom);
}

/* For WebKit browsers (Chrome, Safari, Edge, Brave) */
video.media-viewer-content::-webkit-media-controls {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  z-index: 2147483647;
}

video.media-viewer-content::-webkit-media-controls-panel {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

video.media-viewer-content::-webkit-media-controls-enclosure {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

video.media-viewer-content::-webkit-media-controls-start-playback-button {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

/* Ensure controls container is visible */
video.media-viewer-content::-webkit-media-controls-container {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Document viewer styles */
.document-viewer-modal {
  max-width: 95vw;
  max-height: 95vh;
  width: 90vw;
  height: 90vh;
}

.document-viewer-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--color-bg-body);
  position: relative;
  align-items: stretch;
  justify-content: stretch;
}

.document-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  transition: opacity 0.3s ease-in-out;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* Document loading indicator */
.document-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 2;
  pointer-events: none;
}

.document-loading-indicator .spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
  margin-right: 0;
}

.document-loading-indicator p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .document-viewer-modal {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

.media-not-supported {
  color: white;
  text-align: center;
  padding: 2rem;
}

.media-not-supported p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.media-not-supported button {
  min-width: 200px;
}

/* Account Menu */
.account-menu-container {
  position: relative;
}

button.account-menu-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: none;
  padding: 0.75rem 0.5rem !important;
  cursor: pointer;
  font-size: 1rem;
}

button.account-menu-button:hover {
  color: var(--color-accent);
}

.account-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-bg-card);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border-light);
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  z-index: 100;
  margin-top: 0.5rem;
}

.account-menu-dropdown.show {
  display: flex;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--color-text-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease;
  width: 100%;
  text-align: left;
}

.account-menu-item:hover {
  background-color: var(--color-secondary);
  color: var(--color-primary);
}

.account-menu-item svg {
  color: var(--color-text-muted);
}

.account-menu-item:hover svg {
  color: var(--color-primary);
}

/* Shared Visits List */
.shared-visits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .shared-visits-list {
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
  }
}

.shared-visit-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.shared-visit-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shared-visit-card.expired {
  opacity: 0.7;
  border-color: var(--color-border);
}

.shared-visit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.shared-visit-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.shared-visit-header p {
  margin: 0;
  font-size: 0.9rem;
}

.shared-visit-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .shared-visit-details {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .shared-visit-details {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shared-visit-details > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.shared-visit-details dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shared-visit-details dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-main);
}

.shared-visit-visits-list {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-secondary);
  border-radius: 8px;
}

.shared-visit-visit-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.shared-visit-visit-item:last-child {
  border-bottom: none;
}

.visit-item-date {
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 0.25rem;
}

.visit-item-doctor {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-expired {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-opened {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-pending {
  background-color: rgba(251, 191, 36, 0.1);
  color: #d97706;
}

@media (max-width: 768px) {
  .shared-visits-list {
    grid-template-columns: 1fr;
  }

  .shared-visit-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .shared-visit-details {
    grid-template-columns: 1fr;
  }
}

.account-menu-item.logout {
  color: var(--color-error);
}

.account-menu-item.logout:hover {
  background-color: var(--color-error-bg);
  color: var(--color-error);
}

.account-menu-item.logout svg {
  color: var(--color-error);
}