* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f8fb;
  color: #1f2937;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.topbar,
.app-topbar {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 100;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.topbar-group,
.app-topbar-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar a,
.app-topbar a {
  color: #e2e8f0;
  text-decoration: none;
}

.app-topbar .logo-link {
  display: inline-flex;
  align-items: center;
}

.app-topbar .logo-image-mobile {
  height: 34px;
}

.app-topbar .icon-btn {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

.app-topbar-link {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
}

.app-topbar-link:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.48);
}

.app-mobile-menu-trigger {
  display: inline-flex;
}

.app-topbar-desktop-link {
  display: none;
}

@media (max-width: 640px) {
  .topbar,
  .app-topbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .topbar-group-right {
    margin-left: auto;
  }
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
input[type="file"] {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}

button {
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.job-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eceff3;
}

.job-list small {
  display: block;
  color: #6b7280;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.photo-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}

.photo-card img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.muted {
  color: #6b7280;
}

.notice {
  background: #fff7ed;
  padding: 10px;
  border-left: 4px solid #fb923c;
}

.error {
  color: #b91c1c;
}

.success {
  color: #15803d;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

@media (min-width: 720px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-link {
  display: inline-block;
  margin: 6px 0 14px;
  font-weight: 600;
}

.row-wrap {
  flex-wrap: wrap;
}

.camera-wrap {
  width: 100%;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  max-height: 56vh;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-review {
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: #000;
}

.desktop-video,
.desktop-canvas {
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: #000;
}

.camera-placeholder {
  width: 100%;
  min-height: 220px;
  color: #d1d5db;
  padding: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-link {
  display: inline-block;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  text-decoration: none;
}

/* Dashboard redesign */
.dashboard-page {
  background: #eef2ff;
}

.dashboard-shell {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 260px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px 16px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-image {
  width: 130px;
  max-width: 100%;
}

.logo-image-mobile {
  height: 40px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.sidebar-nav,
.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.sidebar-link {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: #e2e8f0;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.sidebar-link-anchor {
  display: block;
  text-decoration: none;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.48);
}

.sidebar-lower {
  margin-top: auto;
}

.sidebar-beta-disclaimer {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-size: 12px;
  line-height: 1.4;
}

.upgrade-box {
  margin-top: 22px;
  background: linear-gradient(155deg, #1e3a8a, #312e81);
  border-radius: 14px;
  padding: 14px;
}

.upgrade-box h3 {
  margin: 0 0 8px;
  color: #fff;
}

.upgrade-box p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #cbd5e1;
}

.upgrade-box button {
  width: 100%;
  background: #fff;
  color: #1e3a8a;
  font-weight: 700;
}

.sidebar-lower .upgrade-box {
  margin-top: 0;
}

.sidebar-lower .sidebar-footer {
  margin-top: 16px;
}

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

.mobile-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 8px;
}

.mobile-topbar .logo-link {
  display: flex;
  align-items: center;
  height: 40px;
  width: auto;
  max-width: 220px;
  min-width: 0;
}

.mobile-topbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.dashboard-topnav {
  display: none;
  background: #fff;
  border-bottom: 1px solid #dbe3f3;
  padding: 14px 22px;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-wrap input {
  width: min(560px, 100%);
  margin: 0;
  border-radius: 999px;
  background: #f8fafc;
}

.icon-btn {
  border-radius: 10px;
  padding: 8px 10px;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip small {
  display: block;
  color: #64748b;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.dashboard-content {
  padding: 12px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header-row h1 {
  margin: 0;
}

.new-case-btn {
  background: #1d4ed8;
  font-weight: 600;
}

.new-case-btn,
.new-case-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.new-case-btn:hover {
  filter: brightness(0.95);
}

.new-case-btn:active {
  transform: translateY(1px);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.case-grid-header {
  display: none;
  grid-template-columns: 2fr 1fr 90px 120px;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
  padding: 0 8px 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.case-grid {
  display: grid;
  gap: 10px;
}

.case-row {
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

.case-cell {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.case-cell-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.case-title-cell {
  flex-direction: column;
  align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.case-row a {
  font-weight: 600;
  text-decoration: none;
}

.share-link-btn {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.help-modal[hidden] {
  display: none !important;
}

.help-modal-card {
  width: min(620px, 100%);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dbe3f3;
  padding: 16px;
}

.help-feedback-form label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: #0f172a;
}

.help-feedback-form textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 84px;
  resize: vertical;
}

.help-modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.upgrade-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  width: min(460px, calc(100vw - 24px));
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  border: 1px solid #1e293b;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.upgrade-toast[hidden] {
  display: none !important;
}

.upgrade-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.upgrade-toast h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #fff;
}

.upgrade-toast p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.mobile-search,
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  padding: 16px;
}

.mobile-search-inner {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.mobile-search-inner input {
  margin: 0;
}

.mobile-drawer {
  display: flex;
  justify-content: flex-end;
}

.mobile-search[hidden],
.mobile-drawer[hidden] {
  display: none !important;
}

.mobile-drawer-card {
  background: #0f172a;
  color: #e2e8f0;
  width: min(340px, 100%);
  height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 14px;
  overflow: auto;
}

.drawer-link {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: #e2e8f0;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.drawer-link:hover,
.drawer-link:focus {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.48);
}

.drawer-link-anchor {
  margin-bottom: 0;
}

.mobile-user-block {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mobile-user-block small {
  display: block;
  color: #94a3b8;
}

.mobile-beta-disclaimer {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-size: 12px;
  line-height: 1.4;
}

.close-drawer {
  margin-top: 10px;
  width: 100%;
}


.mobile-topbar {
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.28);
}

.mobile-topbar .icon-btn {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

.app-mobile-drawer {
  z-index: 70;
}


.app-mobile-drawer-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}

.app-mobile-drawer-card .close-drawer {
  margin-top: auto;
}

.card {
  border: 1px solid #e5e7eb;
}

#weeklyUsageChart,
#monthlyUsageChart,
#usageTotalsPieChart {
  width: 100%;
  border-radius: 10px;
}

.storage-usage {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.storage-usage-value {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0049a4;
}

.analytics-grid {
  display: grid;
  gap: 14px;
}

.analytics-subtitle {
  margin: 0 0 8px;
  font-size: 14px;
}

.settings-page-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
}

.settings-center-card {
  width: min(560px, 100%);
}

.settings-expanded-card {
  width: min(760px, 100%);
}

.settings-expanded-card form {
  margin-bottom: 20px;
}

.avatar-image {
  object-fit: cover;
}

.settings-page-title {
  text-align: center;
}

@media (max-width: 959px) {
  .dashboard-topnav {
    display: none;
  }

  .card h2 {
    margin-top: 0;
  }

  .new-case-btn {
    width: 100%;
  }
}

@media (min-width: 960px) {
  .dashboard-sidebar {
    display: flex;
  }

  .dashboard-topnav {
    display: flex;
  }

  .mobile-topbar,
  .mobile-search,
  .mobile-drawer {
    display: none !important;
  }

  .app-mobile-menu-trigger {
    display: none;
  }

  .app-topbar-desktop-link {
    display: inline-flex;
  }

  .dashboard-content {
    padding: 22px;
  }

  .analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1120px;
  }

  .case-grid-header {
    display: grid;
  }

  .case-row {
    grid-template-columns: 2fr 1fr 90px 120px;
    align-items: center;
  }

  .case-cell {
    display: block;
  }

  .case-cell-label {
    display: none;
  }

  .case-title-cell {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

.case-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.case-action-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.case-action-btn-muted {
  color: #64748b;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

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

.case-page-topnav {
  display: flex;
}

.back-dashboard-btn {
  width: auto;
  min-width: 170px;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
  /*pointer-events: none;*/
}

.tutorial-overlay[hidden] {
  display: none !important;
}

.tutorial-card {
  /* pointer-events: auto; */
  width: min(560px, 100%);
  /* background: #fff;
  border-radius: 12px; */
  padding: 16px;
  /* box-shadow: 0 15px 40px rgba(15, 23, 42, 0.25); */
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(145deg, rgba(11, 97, 216, 0.95), rgba(8, 22, 44, 0.97));
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: #f2f7ff;
}

.tutorial-card h3 {
  margin: 0 0 8px;
}

.tutorial-card p {
  margin: 0;
  color: #f2f7ff;
}

.tutorial-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tutorial-skip-modal {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(11, 97, 216, 0.95), rgba(8, 22, 44, 0.97));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: #f2f7ff;
  padding: 16px;
}

.tutorial-skip-modal h3 {
  margin: 0 0 8px;
}

.tutorial-skip-modal p {
  margin: 0;
}

.tutorial-skip-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.tutorial-reopen-btn {
  position: fixed;
  top: 30px;
  right: 40px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, rgba(11, 97, 216, 0.95), rgba(8, 22, 44, 0.97));
  color: #f2f7ff;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
  cursor: pointer;
  z-index: 1250;
}

.tutorial-reopen-btn:hover {
  transform: translateY(-1px);
}

.tutorial-reopen-btn:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

input[type="file"].hidden-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
