/* Bhaada — ui: components */

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 16.5px; font-weight: 600;
  background: var(--ink); color: #fff;
  width: 100%;
}
.btn:active { opacity: 0.82; }
.btn-accent { background: var(--accent); }
.btn-ghost { background: var(--paper-dim); color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-outline-danger { background: none; color: var(--red); border: 1.5px solid var(--red-bg); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-slim { min-height: 40px; padding: 8px 14px; font-size: 14.5px; width: auto; }

.fab-add {
  background: var(--accent); color: #fff;
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 28px; font-weight: 400; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,46,0,0.3);
}

/* ---- Summary strip ---- */

.summary-strip {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.summary-card {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.summary-card .num { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.summary-card .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.summary-card.alert { border-color: var(--red-bg); background: var(--red-bg); }
.summary-card.alert .num { color: var(--red); }

/* ---- Search + filters ---- */

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-dim);
  border-radius: var(--radius);
  padding: 0 14px;
  margin-bottom: 10px;
}
.search-box input {
  flex: 1; border: none; background: none; outline: none;
  min-height: var(--tap);
}
.search-box svg { width: 18px; height: 18px; color: var(--ink-faint); flex-shrink: 0; }

.filter-row {
  display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 15px; border-radius: 100px;
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 550;
  white-space: nowrap; color: var(--ink-soft);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Lists ---- */

.group-title {
  font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin: 20px 0 8px;
}
.group-title:first-of-type { margin-top: 6px; }

.card-list { display: flex; flex-direction: column; gap: 8px; }

.row-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px;
  min-height: var(--tap);
  text-align: left; width: 100%;
  background: #fff;
}
.row-card:active { background: var(--paper-dim); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 16.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; font-size: 13.5px; color: var(--ink-soft); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok { background: var(--green); }
.status-dot.soon { background: var(--amber); }
.status-dot.late { background: var(--red); }
.status-dot.none { background: #ccc; }

.badge {
  font-size: 12.5px; font-weight: 650;
  padding: 4px 10px; border-radius: 100px;
  white-space: nowrap; flex-shrink: 0;
}
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.soon { background: var(--amber-bg); color: var(--amber); }
.badge.late { background: var(--red-bg); color: var(--red); }
.badge.none { background: var(--grey-bg); color: var(--ink-soft); }

/* inside a tinted card the badge tint matches the card, so go white for contrast */
.detail-card .badge { display: inline-block; background: #fff; font-size: 13.5px; padding: 6px 13px; }

.call-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.call-btn svg { width: 20px; height: 20px; }

/* ---- Detail page ---- */

.back-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.back-btn {
  display: flex; align-items: center; gap: 4px;
  color: var(--ink-soft); font-size: 15px; font-weight: 550;
  padding: 8px 10px 8px 0;
}
.back-btn svg { width: 20px; height: 20px; }

.detail-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.detail-card.tinted-late { border-color: var(--red-bg); background: var(--red-bg); }
.detail-card.tinted-soon { border-color: var(--amber-bg); background: var(--amber-bg); }
.detail-card.tinted-ok { border-color: var(--green-bg); background: var(--green-bg); }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-top: 12px; }
.kv .k { font-size: 12px; color: var(--ink-soft); }
.kv .v { font-size: 15.5px; font-weight: 600; margin-top: 1px; }

.person-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: none; }
.person-name { flex: 1; min-width: 0; }
.person-name .nm { font-weight: 600; font-size: 16px; }
.person-name .ph { font-size: 13px; color: var(--ink-soft); }
.person-tag { font-size: 11.5px; font-weight: 650; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* the one line that answers "where does this shop stand" */
.headline .k { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.headline .big { font-size: 29px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.15; margin-top: 2px; }

.pay-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  width: 100%; text-align: left;
}
.pay-item:last-child { border-bottom: none; }
.pay-main { flex: 1; min-width: 0; }
.pay-period { display: block; font-size: 15px; font-weight: 600; }
.pay-meta { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.pay-amt { font-weight: 700; font-size: 16px; white-space: nowrap; }

.section-gap { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.lease-note { font-size: 13.5px; margin-top: 10px; padding: 9px 12px; border-radius: 10px; }
.lease-note.warn { background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.lease-note.over { background: var(--red-bg); color: var(--red); font-weight: 600; }

/* ---- Forms ---- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  outline: none;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23999' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 38px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field textarea { min-height: 72px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.form-lead { font-size: 16px; font-weight: 650; margin-bottom: 12px; }

.check-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; margin-bottom: 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer;
}
.check-row input { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; accent-color: var(--accent); }
.check-title { display: block; font-size: 15.5px; font-weight: 600; }
.check-sub { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }

.more-toggle {
  color: var(--ink-soft); font-size: 14.5px; font-weight: 600;
  padding: 10px 0; display: flex; align-items: center; gap: 6px;
}

/* ---- Empty state ---- */

.empty {
  text-align: center; padding: 48px 24px; color: var(--ink-soft);
}
.empty .big-emoji { font-size: 44px; margin-bottom: 12px; }
.empty p { margin-bottom: 18px; font-size: 15.5px; }
.empty .btn { width: auto; padding: 12px 26px; }

/* ---- Settings ---- */

.settings-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  min-height: var(--tap);
  font-size: 16px; font-weight: 550;
}
.settings-item .sub { font-size: 13px; color: var(--ink-soft); font-weight: 400; margin-top: 1px; }
.settings-item .grow { flex: 1; }
.settings-item svg { width: 22px; height: 22px; color: var(--ink-soft); flex-shrink: 0; }
