/* ── View-specific styles ──────────────────────────────────────────────────── */

/* ── Auth ────────────────────────────────────────────────────────────────── */

#view-auth {
  justify-content: center;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-primary);
}

.auth-logo__sub {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

/* ── Jobs list ───────────────────────────────────────────────────────────── */

.job-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.job-card__name {
  font-weight: 600;
  font-size: var(--text-base);
}

.job-card__meta {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: 2px;
}

.job-card__doc-count {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Job form ────────────────────────────────────────────────────────────── */

.client-field-wrap {
  position: relative;
}

#job-address-fields {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

/* ── Job detail ──────────────────────────────────────────────────────────── */

.job-detail__header {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.job-detail__client {
  font-size: var(--text-lg);
  font-weight: 700;
}

.job-detail__address {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: 2px;
}

.job-detail__desc {
  font-size: var(--text-sm);
  margin-top: var(--space-3);
  color: var(--c-text);
  white-space: pre-wrap;
}

.doc-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  min-height: var(--tap);
  transition: background .12s;
}
.doc-list-item:active { background: var(--c-bg); }

.doc-list-item__number {
  font-weight: 700;
  font-size: var(--text-sm);
  min-width: 56px;
}

.doc-list-item__label {
  flex: 1;
  font-size: var(--text-sm);
}

/* ── Document editor ─────────────────────────────────────────────────────── */

.doc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 440px) {
  .doc-meta-grid { grid-template-columns: 1fr; }
}

/* Line items table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.line-items-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-text-muted);
  padding: var(--space-2) var(--space-2);
  border-bottom: 2px solid var(--c-border);
}

.line-items-table td {
  padding: var(--space-1) var(--space-2);
  vertical-align: middle;
}

.line-items-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--c-border);
}

/* Column widths */
.col-desc  { width: 45%; }
.col-qty   { width: 15%; }
.col-price { width: 20%; }
.col-total { width: 15%; text-align: right; }
.col-del   { width: 5%;  text-align: center; }

.li-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: var(--space-1) var(--space-2);
  font-family: inherit;
  font-size: var(--text-sm);
  background: transparent;
  min-height: 36px;
  transition: border-color .15s, background .15s;
}

.li-input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: var(--c-surface);
}

.li-input--num {
  text-align: right;
}

.li-del-btn {
  color: var(--c-text-muted);
  font-size: 18px;
  min-height: 36px;
  min-width: 36px;
}
.li-del-btn:active { color: var(--c-danger); }

.add-line-btn {
  color: var(--c-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) 0;
}

/* Totals block */
.totals-block {
  margin-left: auto;
  width: 260px;
  border-top: 2px solid var(--c-border);
  padding-top: var(--space-3);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: var(--text-sm);
}

.totals-row--total {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: var(--space-2);
  border-top: 1px solid var(--c-border);
  padding-top: var(--space-2);
}

/* Status selector strip */
.status-strip {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.status-btn {
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: 99px;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-muted);
  background: var(--c-surface);
  min-width: unset;
  min-height: 36px;
}

.status-btn[aria-pressed="true"] {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: #e8f0fe;
}

/* Convert button */
.convert-btn {
  border-top: 1px solid var(--c-border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}

/* ── Settings ────────────────────────────────────────────────────────────── */

.settings-logo-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.settings-logo-row input[type="file"] {
  display: none;
}

.logo-upload-btn {
  height: 36px;
  min-height: 36px;
  font-size: var(--text-sm);
  padding: 0 var(--space-4);
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  min-width: unset;
}
