/* JetBrains Mono (techmIsTro wordmark), served from our own site instead of Google Fonts,
   so no visitor details go to Google. Open Font License: see fonts/JetBrainsMono-OFL-LICENSE.txt */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-800-normal.woff2') format('woff2');
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 110px; /* room for the footer, which wraps to two lines on phones */
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Owner dashboard */
.receipts-table tbody tr {
  position: relative; /* lets the date link make the whole row clickable */
}

.receipt-photo {
  min-height: 420px;
}

/* Company branding */
.company-logo {
  height: 36px;
  max-width: 200px;
  object-fit: contain;
}

.signup-logo-preview {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
}

/* "View as" banner for the ReceiptCrew owner */
.view-as-banner {
  background: #6f42c1;
  color: #fff;
  font-size: 0.95rem;
}

/* Receipt photos */
.receipt-photo-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

/* Phone capture page */
.capture-page {
  max-width: 520px;
}

.capture-photo-button {
  padding: 1.25rem 1rem;
  font-size: 1.15rem;
}

.capture-preview {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.capture-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
}

.min-w-0 {
  min-width: 0;
}

/* Full-screen photo viewer (photo-viewer.js) */
.pv-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 15, 20, 0.92);
  display: flex;
  flex-direction: column;
}

.pv-overlay[hidden] {
  display: none;
}

.pv-toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  flex-wrap: wrap;
}

.pv-toolbar button,
.pv-toolbar a {
  min-width: 44px;
  height: 44px;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pv-toolbar .pv-close {
  margin-left: 1rem;
  font-size: 1.6rem;
}

.pv-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.pv-stage img {
  max-width: none;
  flex: none;
  cursor: grab;
  user-select: none;
  transform-origin: center center;
  will-change: transform;
}

.pv-stage img:active {
  cursor: grabbing;
}

body.pv-open {
  overflow: hidden;
}

.receipt-photo-img {
  cursor: zoom-in;
}

/* Owner dashboard: big totals and a header row that stays visible while scrolling */
.receipt-total-value {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .receipt-total-value {
    font-size: 1.15rem;
  }
}

.receipts-table-wrap {
  max-height: 70vh;
  overflow: auto;
}

/* Owner's Settings page */
.settings-page {
  max-width: 1080px;
}

.settings-tabs .nav-link {
  color: #4B5563;
}

.settings-tabs .nav-link.active {
  font-weight: 600;
}

/* Keep the simple tabs at a comfortable reading width; Look & feel uses the full width */
#company, #categories, #jobs {
  max-width: 760px;
}

/* Look & feel: numbered steps on the left */
.look-step {
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: var(--bs-body-bg);
}

.look-step-title {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.look-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #1F2937;
  color: #fff;
  font-size: 0.85rem;
}

/* Look & feel: the preview stays in view while scrolling (on a computer) */
.look-preview-wrap {
  position: sticky;
  top: 1rem;
}

.look-preview-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Look & feel: save bar at the bottom of the screen; yellow when something isn't saved */
.look-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: var(--bs-tertiary-bg);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.look-savebar-changed {
  background: #FFF3CD;
  border-color: #FFDA6A;
}

.look-savebar-changed .look-savebar-text {
  font-weight: 600;
  color: #664D03;
}

.settings-logo-preview {
  max-height: 72px;
  max-width: 260px;
  object-fit: contain;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.settings-rename {
  flex: 1 1 220px;
  margin: 0;
}

.settings-used {
  min-width: 100px;
}

/* Settings > Look & feel: colors found on their website or photo */
.look-found {
  background: var(--bs-tertiary-bg);
  border-radius: 8px;
  padding: 0.75rem;
}

.look-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.look-swatch-color {
  display: block;
  width: 100%;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--bs-border-color);
}

/* Settings > Look & feel preview: a small copy of the top of a page (driven by look-preview.js) */
.look-preview {
  --lp-main: #0D6EFD;
  --lp-main-on: #FFFFFF;
  --lp-ink: #0D6EFD;
  --lp-header-bg: #FFFFFF;
  --lp-header-fg: #1F2937;
  --lp-name: #1F2937;
  --lp-font: inherit;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.lp-header {
  background: var(--lp-header-bg);
  color: var(--lp-header-fg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.6rem 0.75rem 0;
}

.lp-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.lp-logo {
  max-height: 36px;
  max-width: 160px;
  object-fit: contain;
}

.lp-colored-header .lp-logo {
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
}

.lp-name {
  font-family: var(--lp-font);
  font-weight: 700;
  color: var(--lp-name);
}

.lp-nav {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.4rem;
  font-family: var(--lp-font);
}

.lp-nav span {
  padding-bottom: 0.35rem;
}

.lp-nav .lp-active {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--lp-main);
}

.lp-colored-header .lp-nav .lp-active {
  box-shadow: inset 0 -2px 0 var(--lp-header-fg);
}

.lp-body {
  padding: 0.75rem;
  color: #1F2937;
}

.lp-heading {
  font-family: var(--lp-font);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.lp-link {
  color: var(--lp-ink);
  text-decoration: underline;
}

.lp-button {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  background: var(--lp-main);
  border: 1px solid var(--lp-main);
  color: var(--lp-main-on);
}

.lp-button.lp-outline {
  background: transparent;
  color: var(--lp-ink);
}

/* Privacy and Terms pages: a comfortable reading width */
.legal-page {
  max-width: 720px;
}

/* "Need review" dashboard box is clickable: a light hover so it feels like a button */
.receipt-total-link:hover {
  background: var(--bs-tertiary-bg);
}

/* Column titles and the filter row under them stay put while the list scrolls */
.receipts-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.receipts-table thead th {
  background: var(--bs-body-bg);
  cursor: help;
}

.receipts-table thead tr:last-child th {
  box-shadow: inset 0 -1px 0 var(--bs-border-color);
}

.receipt-filter-row th {
  cursor: default;
  font-weight: normal;
  padding-top: 0;
  min-width: 120px;
}

.receipt-filter-row th:nth-child(6) {
  min-width: 0; /* Amount has no filter */
}

/* Product and company names on every page */
.app-name {
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #1F2937;
}

.app-name-small {
  font-size: 0.95rem;
  color: #4B5563;
}

/* Top of every page: company logo with the name under it, centered */
.site-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.company-logo-top {
  max-height: 64px;
  max-width: 260px;
  object-fit: contain;
}

.company-name-top {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1F2937;
}

/* Menu: underline the page you're on, in the company's color */
.navbar .nav-link.active {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--brand, #0F766E);
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: #D1D5DB;
}

.made-by {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
}

.made-by-app {
  font-weight: 600;
  color: #1F2937;
}

/* techmIsTro brand: JetBrains Mono, dark gray, I and T teal and extra bold */
.techmistro-wordmark {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: #1F2937;
}

.techmistro-wordmark b {
  font-weight: 800;
  color: #0F766E;
}
