/* Till Sunset Handyman — Team / Independent Contractor Portal (/team) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #f6f4fb; color: #1f1938; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: #3B2E7A; }
.boot { text-align: center; padding: 48px 16px; color: #5b527a; font-weight: 600; }

/* Shell */
.t-top {
  background: linear-gradient(135deg, #2d2163, #4a3796); color: #fff;
  padding: 14px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
}
.t-brand { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.t-brand strong { font-size: 19px; letter-spacing: -.01em; }
.t-brand span { font-size: 13px; background: rgba(255,255,255,.18); padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.t-top-acts { display: flex; gap: 8px; align-items: center; }

.t-tabs {
  display: flex; gap: 6px; padding: 10px 12px; background: #fff; border-bottom: 1.5px solid #e3ddf2;
  overflow-x: auto; position: sticky; top: 0; z-index: 40;
}
.t-tabs button {
  flex: 0 0 auto; border: 1.5px solid #dcd4f0; background: #faf9fe; color: #2a2055;
  font: inherit; font-size: 15px; font-weight: 700; padding: 10px 14px; border-radius: 12px;
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
}
.t-tabs button.on { background: #3B2E7A; color: #fff; border-color: #3B2E7A; }
.t-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #d92d20; color: #fff; font-size: 12px; font-weight: 800; line-height: 1;
}

.t-main { max-width: 780px; margin: 0 auto; padding: 14px 12px 48px; display: grid; gap: 14px; }
.t-card { background: #fff; border: 1.5px solid #e3ddf2; border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(32, 22, 74, .04); }
.t-card h2 { margin: 0 0 10px; font-size: 19px; color: #241a52; }
.t-card h3 { margin: 14px 0 8px; font-size: 16px; color: #241a52; }
.t-hint { font-size: 14px; color: #5b527a; margin: 0 0 10px; }

/* Forms & Buttons */
label.t-lbl { display: block; font-size: 14px; font-weight: 700; color: #2c2356; margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 11px;
  border: 1.5px solid #ccc4e2; background: #fff; color: #1f1938; min-height: 46px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #3B2E7A; box-shadow: 0 0 0 3px rgba(59, 46, 122, .14); }
.t-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 15px; font-weight: 700; padding: 11px 16px; min-height: 46px;
  border-radius: 12px; border: 1.5px solid #ccc4e2; background: #fff; color: #261d52;
  cursor: pointer; text-decoration: none;
}
.tbtn.primary { background: #3B2E7A; border-color: #3B2E7A; color: #fff; }
.tbtn.primary:hover { background: #2d2163; }
.tbtn.small { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.tbtn.ghost { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; min-height: 38px; padding: 6px 12px; font-size: 13.5px; }
.tbtn:disabled { opacity: .55; cursor: not-allowed; }
.t-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.t-acts.end { justify-content: flex-end; }

/* Login */
.t-login-wrap { max-width: 420px; margin: 40px auto; padding: 0 14px; }
.t-err { background: #fee2e2; border: 1.5px solid #dc2626; color: #991b1b; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; margin: 10px 0; }

/* Alert Bar */
.t-alertbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  background: #f2edff; border: 1.5px solid #d5cbf5; border-radius: 14px; padding: 11px 14px;
}
.t-alertbar span { font-size: 14px; font-weight: 600; color: #261d52; }

/* Quote Builder + Auto-pricing */
.t-line { background: #faf9fe; border: 1.5px solid #e3ddf2; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.t-line-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.t-line-row { display: grid; grid-template-columns: 90px 1fr 110px; gap: 8px; margin-top: 8px; align-items: end; }
.t-line-amt { text-align: right; font-weight: 800; font-size: 17px; padding-bottom: 10px; color: #241a52; }

.ap-wrap { position: relative; }
.ap-sug {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  background: #fff; border: 2px solid #3B2E7A; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(32, 22, 74, .22); max-height: 290px; overflow-y: auto;
}
.ap-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border: 0; border-bottom: 1px solid #ece8f6; background: #fff;
  text-align: left; font: inherit; font-size: 15px; cursor: pointer; min-height: 46px;
}
.ap-item:last-child { border-bottom: 0; }
.ap-item:hover, .ap-item:focus { background: #f3effd; outline: none; }
.ap-price { color: #2d6a4f; white-space: nowrap; }

.t-splitbox {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0;
  background: #f5f2ff; border: 1.5px solid #d5cbf5; border-radius: 12px; padding: 12px;
}
.t-splitbox div { display: flex; flex-direction: column; gap: 2px; }
.t-splitbox span { font-size: 12.5px; color: #5b527a; font-weight: 700; }
.t-splitbox strong { font-size: 20px; color: #241a52; }
.t-splitbox .mine strong { color: #1f6b47; }

.t-azwarn {
  margin: 10px 0; padding: 12px 14px; border-radius: 12px;
  background: #fff3cd; border: 2px solid #d97706; color: #7c2d12; font-weight: 700; font-size: 14.5px;
}
.t-aznote {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: #f8f6fe; border: 1px solid #e3ddf2; color: #463c68; font-size: 13.5px;
}

/* Status pills & Quote cards */
.t-qcard { border: 1.5px solid #e3ddf2; border-radius: 14px; padding: 14px; margin-bottom: 10px; background: #fff; }
.t-qhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.t-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.t-pill.pending { background: #ffedd5; color: #9a3412; }
.t-pill.approved { background: #dcfce7; color: #166534; }
.t-pill.needs_changes { background: #fef3c7; color: #92400e; }
.t-pill.rejected { background: #fee2e2; color: #991b1b; }
.t-pill.mine { background: #ede9fe; color: #4c1d95; }

.t-items { list-style: none; padding: 0; margin: 8px 0; border-top: 1px solid #ece8f6; }
.t-items li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #ece8f6; font-size: 14.5px; }

/* Work Board */
.t-feed {
  display: flex; flex-direction: column; gap: 10px; max-height: 390px; overflow-y: auto;
  padding: 12px; background: #f8f6fe; border: 1px solid #e3ddf2; border-radius: 12px; margin-bottom: 10px;
}
.t-msg { background: #fff; border: 1px solid #e3ddf2; border-radius: 12px; padding: 10px 12px; max-width: 92%; }
.t-msg.me { align-self: flex-end; background: #f0ecff; border-color: #c8bbf5; }
.t-msg.owner { align-self: flex-start; border-left: 4px solid #e85d04; }
.t-msg-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: #5b527a; margin-bottom: 4px; }
.t-msg-meta strong { color: #1f1938; }
.t-jobtag { padding: 2px 8px; border-radius: 999px; background: #fff3cd; color: #7c2d12; font-weight: 700; font-size: 11.5px; }
.t-msg-body { margin: 0; font-size: 15px; white-space: pre-wrap; }

.t-status-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.t-status-row button { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid #ccc4e2; background: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.t-status-row button.on { background: #3B2E7A; color: #fff; border-color: #3B2E7A; }

/* Toast & Banner */
.t-toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9998;
  background: #1f1938; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 24px); text-align: center;
}
.t-toast.bad { background: #b42318; }
.t-ntf-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999;
  width: min(500px, calc(100vw - 24px)); background: #261d52; color: #fff;
  border: 2px solid #f4a261; border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.3); display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.t-ntf-title { margin: 0 0 2px; font-weight: 800; color: #ffd166; font-size: 15px; }
.t-ntf-body { margin: 0; font-size: 14px; }

/* Printable 50/50 Agreement */
.agr-body { background: #fff; color: #111; }
.agr-doc { max-width: 760px; margin: 0 auto; padding: 28px 24px 48px; }
.agr-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.agr-doc h1 { font-size: 23px; margin: 0 0 6px; color: #1f1938; }
.agr-sub { color: #555; margin: 0 0 20px; font-size: 14px; }
.agr-sec { margin-bottom: 16px; }
.agr-sec h2 { font-size: 16px; margin: 0 0 6px; color: #2d2163; border-bottom: 1px solid #e0daf0; padding-bottom: 4px; }
.agr-sec p, .agr-sec li { font-size: 14.5px; line-height: 1.55; }
.agr-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 36px; }
.sig-line { border-bottom: 1.5px solid #222; height: 34px; margin-bottom: 6px; }
.sig-date { color: #444; font-size: 13.5px; }
.agr-note { margin-top: 28px; font-size: 12.5px; color: #666; }

.t-prog { width: 100%; height: 12px; border-radius: 999px; overflow: hidden; border: 0; background: #ede9f8; margin-top: 6px; appearance: none; -webkit-appearance: none; }
.t-prog::-webkit-progress-bar { background: #ede9f8; border-radius: 999px; }
.t-prog::-webkit-progress-value { background: linear-gradient(90deg, #3B2E7A, #1f6b47); border-radius: 999px; }
.t-prog::-moz-progress-bar { background: linear-gradient(90deg, #3B2E7A, #1f6b47); border-radius: 999px; }

@media print { .no-print { display: none !important; } .agr-doc { padding: 0; } }
@media (max-width: 560px) {
  .t-grid2, .t-splitbox, .agr-sigs { grid-template-columns: 1fr; }
  .t-line-row { grid-template-columns: 74px 1fr 96px; }
}
