/* SOS Radiology - SaveOnScan.com - light theme styles */

:root {
  --sos-bg: #f3f4f6;
  --sos-bg-soft: #ffffff;
  --sos-accent: #0f766e;
  --sos-accent-soft: rgba(15, 118, 110, 0.08);
  --sos-text: #111827;
  --sos-muted: #6b7280;
  --sos-border: #e5e7eb;
  --sos-danger: #b91c1c;
  --sos-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e5e7eb 0, #f9fafb 60%);
  color: var(--sos-text);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--sos-bg-soft);
  border-radius: 1.25rem;
  border: 1px solid var(--sos-border);
  box-shadow: var(--sos-shadow-soft);
  padding: 1.75rem;
}

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

.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-title span.logo-dot {
  display: inline-flex;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--sos-accent));
  box-shadow: 0 0 0 5px rgba(34, 197, 194, 0.3);
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--sos-muted);
}

.badge-pill {
  border-radius: 999px;
  border: 1px solid var(--sos-border);
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  color: var(--sos-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f9fafb;
}

.badge-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sos-muted);
}

.field-helper {
  font-size: 0.75rem;
  color: var(--sos-muted);
}

.select-input,
.text-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--sos-border);
  background: #f9fafb;
  color: var(--sos-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.select-input:focus,
.text-input:focus {
  border-color: var(--sos-accent);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.4);
  background: #ffffff;
}

.text-input::placeholder {
  color: rgba(156, 163, 175, 0.9);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--sos-border);
  color: var(--sos-muted);
  background: #f9fafb;
}

/* Suggestions dropdown */
.suggestions {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.3rem;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid var(--sos-border);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 40;
}

.suggestion-item {
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #f3f4f6;
}

.suggestion-title {
  color: var(--sos-text);
}

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

/* Results table */
.results-panel {
  margin-top: 0.5rem;
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--sos-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-table-wrapper {
  border-radius: 1rem;
  border: 1px solid var(--sos-border);
  background: #ffffff;
  overflow: hidden;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.results-table thead {
  background: #f9fafb;
}

.results-table th,
.results-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.results-table th {
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sos-muted);
}

.results-table td {
  color: var(--sos-text);
}

.results-table tbody tr:hover {
  background: #f9fafb;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--sos-accent-soft);
  color: #022c22;
}

.price-pill-muted {
  background: #e5e7eb;
  color: var(--sos-muted);
}

/* Share / WhatsApp panel */
.share-panel {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--sos-border);
}

.share-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.share-hint {
  font-size: 0.75rem;
  color: var(--sos-muted);
}

.share-text {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border-radius: 0.9rem;
  border: 1px solid var(--sos-border);
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f9fafb;
  color: var(--sos-text);
  margin-bottom: 0.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--sos-accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.35);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: #115e59;
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(15, 118, 110, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 25px rgba(15, 118, 110, 0.3);
}

.copy-status {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--sos-muted);
}

/* Footer */
.footer {
  margin-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--sos-muted);
  flex-wrap: wrap;
}

/* Utility badges */
.badge-tag {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-disclaimer {
  max-width: 520px;
}

.logout-btn {
  padding-inline: 0.9rem;
  padding-block: 0.35rem;
  font-size: 0.78rem;
  text-decoration: none;
}


/* Login card */
.login-card {
  max-width: 420px;
  margin: 5rem auto;
}

.login-title {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--sos-muted);
  margin-bottom: 1.2rem;
}

.login-error {
  margin-bottom: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.8rem;
}

.login-form .field-group + .field-group {
  margin-top: 0.6rem;
}

.login-button {
  width: 100%;
  margin-top: 1rem;
}

/* Responsiveness */
@media (max-width: 768px) {
  .app-shell {
    padding: 1rem;
  }
  .card {
    padding: 1.2rem;
    border-radius: 1rem;
  }
  .search-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .app-title {
    font-size: 1.25rem;
  }
}


  .results-table th:nth-child(2),
  .results-table td:nth-child(2) {
    display: none; /* hide dept on very small screens for compactness */
  }
}

/* Film toggle row */
.film-toggle {
  margin-top: 0.6rem;
}
.film-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
}
.film-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.film-toggle-text {
  display: inline-flex;
  flex-direction: column;
}
.film-toggle-sub {
  font-size: 0.7rem;
  color: var(--sos-muted);
}

/* Slightly tighter padding on small screens so content doesn't feel cramped */






@media (max-width: 640px) {
  .card {
    padding: 1.05rem;
  }

  .results-panel {
    margin-top: 0.75rem;
  }

  .results-table-wrapper {
    border-radius: 0.9rem;
    border: 1px solid var(--sos-border);
    background: transparent;
    padding: 0.1rem 0;
    overflow: visible; /* allow cards to occupy full width/height */
  }

  .results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }

  .results-table thead {
    display: none;
  }

  .results-table tbody {
    display: block;
    width: 100%;
  }

  .results-table tbody tr {
    display: block;
    background: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    padding: 0.7rem 0.9rem 0.8rem;
    margin: 0 0 0.75rem 0;
  }

  .results-table tbody tr td {
    border-bottom: none;
    padding: 0.12rem 0;
  }

  /* First line: code left, dept right (underlined subtle label style) */
  .results-table tbody tr td:nth-child(1),
  .results-table tbody tr td:nth-child(2) {
    display: inline-block;
    width: 49%;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sos-muted);
    text-decoration: underline;
  }

  .results-table tbody tr td:nth-child(1) {
    text-align: left;
  }

  .results-table tbody tr td:nth-child(2) {
    text-align: right;
  }

  /* Scan name as the main title row */
  .results-table tbody tr td:nth-child(3) {
    display: block;
    font-weight: 600;
    font-size: 0.96rem;
    margin-top: 0.3rem;
    margin-bottom: 0.2rem;
  }

  /* Day / Night row: two equal columns beneath title */
  .results-table tbody tr td:nth-child(4),
  .results-table tbody tr td:nth-child(5) {
    display: inline-block;
    width: 49%;
    margin-top: 0.35rem;
    vertical-align: top;
  }

  .results-table tbody tr td:nth-child(4) {
    text-align: left;
  }

  .results-table tbody tr td:nth-child(5) {
    text-align: right;
  }

  .results-table tbody tr td:nth-child(4)::before,
  .results-table tbody tr td:nth-child(5)::before {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.12rem;
    color: var(--sos-muted);
  }

  .results-table tbody tr td:nth-child(4)::before {
    content: 'Day';
  }

  .results-table tbody tr td:nth-child(5)::before {
    content: 'Night';
  }

  .results-table tbody tr td .price-pill,
  .results-table tbody tr td .price-pill.price-pill-muted {
    font-size: 0.85rem;
    padding-inline: 0.45rem;
  }
}


/* FILM TOGGLE POLISH */
.film-toggle {
  margin-bottom:1.1rem;
}
.film-toggle-row {
  display:flex;
  align-items:center;
  gap:0.6rem;
  background:#f8fafc;
  padding:0.65rem 0.75rem;
  border-radius:8px;
  border:1px solid var(--sos-border);
}
.film-toggle-row input[type="checkbox"] {
  width:18px;
  height:18px;
  accent-color:var(--sos-accent);
}
.film-toggle-text {
  display:flex;
  flex-direction:column;
  font-size:0.82rem;
}
.film-toggle-sub {
  font-size:0.72rem;
  color:var(--sos-muted);
}


/* Branch availability panel (variant 2) */
.branch-panel {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--sos-border);
}

.branch-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.branch-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
}

.branch-hint {
  font-size: 0.8rem;
  color: var(--sos-muted);
  max-width: 280px;
}

.branch-empty {
  font-size: 0.8rem;
  color: var(--sos-muted);
  margin-top: 0.25rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.chip.branch-chip {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--sos-accent-soft);
  color: #022c22;
  cursor: default;
}


/* Branch details modal (v13.1_variant2) */
.branch-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}

.branch-modal {
  background: #ffffff;
  border-radius: 0.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.branch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--sos-border);
}

.branch-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.branch-modal-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.branch-modal-body {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.branch-modal-footer {
  padding: 0.75rem 1rem 0.9rem;
  border-top: 1px solid var(--sos-border);
  display: flex;
  justify-content: flex-end;
}
