/* Team approvals page — builds on styles.css */
.team-page { background: #f6f1ea; }
.team-chip { margin-right: auto; margin-left: 4px; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; background: var(--green); color: #fff; padding: 5px 10px; border-radius: 999px; }
.btn-text { background: none; border: 0; padding: 10px 6px; font: 600 .9rem Inter, system-ui, sans-serif; color: var(--green); cursor: pointer; }
.btn-text:hover { text-decoration: underline; }

.team-main { max-width: 760px; margin: 0 auto; padding: 22px var(--gutter) 80px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* sign in */
.login-card { background: var(--paper); border: 1px solid var(--line); border-radius: 28px; padding: 28px 22px; max-width: 420px; margin: 24px auto; box-shadow: 0 40px 70px -50px rgba(10, 51, 32, .7); animation: rise .6s var(--ease) both; }
.login-card h1 { font-size: 1.9rem; }
.login-emblem { width: 48px; margin-bottom: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--tint); color: var(--green); font: 600 .8rem Inter, sans-serif; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* header strip */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hello h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); margin: 0; }
.hello .eyebrow { margin-bottom: 6px; }
.role-badge { font-size: .8rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: #e5f1e4; color: var(--green); }

/* tabs */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 4px; position: sticky; top: 70px; z-index: 5; }
.tabs button { border: 0; background: transparent; border-radius: 12px; padding: 11px 4px; font: 600 .85rem Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .25s, color .25s; }
.tabs button[aria-selected="true"] { background: var(--green); color: #fff; }
.count { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: var(--tint); color: var(--green); font-size: .75rem; }
.tabs button[aria-selected="true"] .count { background: rgba(255, 255, 255, .2); color: #fff; }
.tabs button[data-status="pending"] .count.has { background: var(--berry); color: #fff; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; }
.toolbar p { margin: 0; }

/* application cards */
.app-list { display: grid; gap: 14px; }
.app-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 18px; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.app-head h2 { font-size: 1.35rem; margin: 0 0 2px; }
.app-when { font-size: .78rem; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.app-person { margin: 0; color: var(--muted); font-size: .92rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.fact { background: #fbf7f2; border-radius: 14px; padding: 10px 12px; }
.fact span { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact strong { font-size: .95rem; color: var(--ink); }
.fact.wide { grid-column: 1 / -1; }
.app-notes { background: #fff8e6; border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; padding: 10px 12px; font-size: .92rem; margin: 0 0 12px; }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; color: var(--green); font-weight: 600; font-size: .85rem; background: #fff; }
.chip-link:hover { border-color: var(--green); }
.chip-link.wa { background: #e7f9ee; border-color: #bdeccd; color: #0b6b33; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { min-height: 48px; padding: 10px 14px; font-size: .95rem; }
.btn-soft-red { background: #fff0f0; color: var(--berry-dark); border-color: #f3c2c8; }

.review-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.review-summary span { font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: #e5f1e4; color: var(--green); }
.app-card.rejected .review-summary span { background: #fff0f0; color: var(--berry-dark); }
.review-by { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }

/* approve / reject panel */
.panel-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); animation: rise .35s var(--ease) both; }
.panel-box h3 { font-size: 1.05rem; margin-bottom: 12px; }
.panel-box .chips span { font-size: .85rem; }
.panel-box .chips input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.credit-days { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.credit-days input { width: 90px !important; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: 24px; }
.empty svg { width: 44px; margin: 0 auto 10px; display: block; }

/* section switch: Orders | Applications */
.section-switch { display: flex; gap: 6px; margin: 0 -16px 14px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.section-switch::-webkit-scrollbar { display: none; }
.section-switch button[hidden] { display: none; }
.section-switch button { flex: 0 0 auto; padding: 11px 14px !important; font-size: .88rem !important; white-space: nowrap; border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px; font: 600 .95rem Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 6px; }
.section-switch button[aria-selected="true"] { border-color: var(--green); color: var(--green); background: #e5f1e4; }
.section-switch .count.has { background: var(--berry); color: #fff; }
.section-switch .count.zero { display: none; }

/* orders */
.team-dates { margin-bottom: 4px; }
.win-block { margin: 14px 0 22px; }
.win-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 4px 8px; }
.win-head h2 { font-size: 1.3rem; margin: 0; }
.win-head span { font-size: .8rem; color: var(--muted); }
.totals { background: var(--green-900); color: #e9f1ea; border-radius: 20px; padding: 14px 16px; margin-bottom: 10px; }
.totals ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.totals li { display: flex; justify-content: space-between; font-size: .92rem; }
.totals li strong { color: #fff; font-family: var(--display); }
.totals .t-all { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 6px; padding-top: 6px; font-weight: 600; }
.totals .t-note { font-size: .78rem; color: #a9c0ae; margin: 6px 0 0; }
.ord-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin-bottom: 10px; animation: rise .4s var(--ease) both; }
.ord-card.proj { border-style: dashed; background: #fbf9f6; }
.ord-card h3 { font-family: var(--display); font-size: 1.1rem; margin: 0; }
.ord-sub { font-size: .82rem; color: var(--muted); margin: 2px 0 8px; }
.ord-card .actions { margin-top: 10px; }
.ord-card .actions .btn { min-height: 44px; font-size: .9rem; }

/* plan */
.buy-card { background: var(--green-900); color: #e9f1ea; border-radius: 24px; padding: 18px; margin-bottom: 12px; }
.buy-card h2 { color: #fff; font-size: 1.3rem; margin: 0 0 4px; }
.buy-card .sub { font-size: .82rem; color: #a9c0ae; margin: 0 0 12px; }
.buy-row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.buy-row:first-of-type { border-top: 0; }
.buy-row .need { font-size: .82rem; color: #a9c0ae; text-align: right; }
.buy-row .buy { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--gold); text-align: right; min-width: 70px; }
.buy-row.total { border-top: 1px solid rgba(255, 255, 255, .3); font-weight: 600; }
.buy-row.total .buy { color: #fff; }
.split-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.plan-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 12px; overflow-x: auto; }
.plan-card h3 { font-family: var(--display); font-size: 1.1rem; margin: 0 0 8px; }
.ptable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ptable th { text-align: right; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 4px 0 6px 10px; }
.ptable th:first-child, .ptable td:first-child { text-align: left; padding-left: 0; }
.ptable td { text-align: right; padding: 7px 0 7px 10px; border-top: 1px solid #f1ebe4; white-space: nowrap; }
.ptable td:first-child { white-space: normal; }
.ptable tr.tot td { font-weight: 700; color: var(--green); border-top: 1.5px solid var(--line); }

/* delivery */
.progress-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; }
.progress-card .bar { height: 10px; border-radius: 999px; background: #f1ebe4; overflow: hidden; margin-top: 8px; }
.progress-card .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--green)); border-radius: 999px; transition: width .6s var(--ease); }
.progress-card .p-top { display: flex; justify-content: space-between; font-weight: 600; }
.progress-card .p-top span { color: var(--muted); font-weight: 500; font-size: .88rem; }
.zone-head { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--leaf); margin: 14px 4px 8px; }
.stop.done { background: #f2f8f1; border-color: #cfe5cc; }
.stop.done .up-items, .stop.done .contact-row { display: none; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fbf7f2; border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin: 6px 0 10px; }
.pay-line strong { font-family: var(--display); font-size: 1.15rem; color: var(--berry-dark); }
.pay-line.none strong { color: var(--muted); font-family: Inter, sans-serif; font-size: .85rem; font-weight: 600; }
.issue { background: #fff0f0; color: var(--berry-dark); border-radius: 12px; padding: 8px 12px; font-size: .88rem; margin: 6px 0; }
.amount-input { display: flex; align-items: center; gap: 8px; }
.amount-input span { font-weight: 700; font-size: 1.1rem; }

/* founder dashboard */
.dash-h { font-size: 1.15rem; margin: 22px 4px 10px; }
.dash-h:first-child { margin-top: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-label { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.t-value { font-family: var(--display); font-weight: 800; font-size: 1.55rem; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.t-sub { font-size: .78rem; color: var(--muted); }
.tile.good { border-color: #cfe5cc; background: #f2f8f1; }
.tile.warn { border-color: #f3d9a4; background: #fff8e6; }
.tile.later { border-style: dashed; background: transparent; }
.tile.later .t-value { color: #c9bfb5; }
.alerts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.alerts li { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 1px solid #f3d9a4; border-radius: 14px; padding: 10px 12px; font-size: .9rem; }
.alerts li span:nth-child(2) { flex: 1; }
.a-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #b7791f; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-head h3 { margin: 0; }
.chart-wrap { position: relative; margin-top: 6px; }
.chart-wrap svg { display: block; max-width: 100%; }
.c-grid { stroke: #f1ebe4; stroke-width: 1; }
.c-base { stroke: #d9cfc4; stroke-width: 1; }
.c-tick { font: 500 10px Inter, sans-serif; fill: var(--muted); }
.c-val { font: 700 11px Inter, sans-serif; fill: var(--ink); }
.c-bar { fill: #3b8f3a; }
.c-bar.today { fill: var(--green); }
.c-hit { fill: transparent; cursor: pointer; outline: none; }
.c-hit:hover, .c-hit:focus { fill: rgba(15, 77, 46, .06); }
.chart-tip { position: absolute; z-index: 2; width: 150px; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: .78rem; display: grid; gap: 1px; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-size: .8rem; }
.chart-table { margin-top: 8px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--green); font-weight: 600; padding: 4px 0; }

/* customers (CRM) */
.crm-tools { display: grid; gap: 8px; margin-bottom: 12px; }
.crm-tools input { width: 100%; }
.type-chips { display: flex; gap: 6px; }
.type-chips button { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font: 600 .85rem Inter, sans-serif; color: var(--muted); cursor: pointer; }
.type-chips button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.cust-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.cust-row:hover { border-color: var(--green); }
.cust-row strong { font-family: var(--display); font-size: 1.02rem; }
.cust-row .meta { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cust-row .spent { font-weight: 700; color: var(--green); text-align: right; }
.type-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #eef0ff; color: #3b44a0; margin-left: 6px; vertical-align: middle; }
.type-tag.business { background: #e5f1e4; color: var(--green); }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-list span { font-size: .72rem; background: #fff3d6; color: #8a5a00; border-radius: 999px; padding: 2px 8px; }
.crm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 6px 0 10px; }
.crm-head h2 { margin: 0; font-size: 1.5rem; }
.crm-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .88rem; }
.crm-list li { display: flex; justify-content: space-between; gap: 10px; background: #fbf7f2; border-radius: 12px; padding: 8px 10px; }
.crm-list li small { display: block; color: var(--muted); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.edit-grid .full { grid-column: 1 / -1; }
.inbox-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.inbox-card .msg { background: #fbf7f2; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.rating-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 6px; font-size: .9rem; }
.rating-row .st { color: var(--gold); white-space: nowrap; }
.drv-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.drv-row select { flex: 1; padding: 9px 12px; font-size: .9rem; }
.pay-line.paid strong { color: var(--leaf); }

/* operations screens (team-ops.js) */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl-wrap .ptable td small { font-size: .74rem; }
.ptable tr.owes td:nth-child(5) { color: var(--berry-dark); font-weight: 700; }
.ptable input, .ptable select { padding: 7px 8px; font-size: .85rem; border-radius: 10px; }
.price-edit { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.type-chips.wrap { flex-wrap: wrap; }
.dispatch .plan-card { margin-bottom: 12px; }
.iq-card { border-color: #f5c8cf; background: #fff6f7; }
.iq-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #f5dde0; }
.iq-row:first-of-type { border-top: 0; }
.iq-row small { display: block; color: var(--muted); font-size: .78rem; }
.iq-time { font-family: var(--display); font-weight: 800; color: var(--green); white-space: nowrap; }
.iq-row.late .iq-time { color: var(--berry-dark); }
.drv-card { border-top: 1px solid #f1ebe4; padding: 10px 0; }
.drv-card:first-of-type { border-top: 0; }
.stage { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.stage summary { font-weight: 700; cursor: pointer; color: var(--green); }
.lead { border-top: 1px solid #f1ebe4; padding: 10px 0; }
.lead.overdue { background: #fff8e6; border-radius: 12px; padding: 10px; }
.lead-notes { white-space: pre-line; background: #fbf7f2; border-radius: 10px; padding: 6px 10px; }
.lead-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.lead-edit input, .lead-edit select { padding: 8px 10px; font-size: .88rem; }
.mini-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 6px; border-bottom: 1px solid #d9cfc4; }
.mini-bars .mb { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.mini-bars .mb i { display: block; width: 100%; max-width: 24px; margin: 0 auto; height: var(--h); background: #3b8f3a; border-radius: 4px 4px 0 0; }
.mini-bars .mb:hover i { background: var(--green); }
.mb-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* live delivery: my route, arranging */
.route-list { list-style: none; counter-reset: rt; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.route-list li { counter-increment: rt; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; background: #fbf7f2; border-radius: 12px; padding: 8px 10px; }
.route-list li::before { content: counter(rt); width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.route-list small { display: block; color: var(--muted); font-size: .76rem; }
.arranger { margin-top: 10px; padding: 10px; border: 1.5px dashed var(--line); border-radius: 14px; background: #fffdfa; }
.arr-row { display: grid; grid-template-columns: 26px 1fr 34px 34px 34px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid #f1ebe4; }
.arr-row:first-of-type { border-top: 0; }
.arr-n { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--green-900); display: grid; place-items: center; font-weight: 800; font-size: .78rem; }
.arr-name small { display: block; color: var(--muted); font-size: .74rem; }
.arr-btn { height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; color: var(--green); cursor: pointer; }
.arr-btn[disabled] { opacity: .3; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); background: var(--green-900); color: #fff; padding: 13px 18px; border-radius: 16px; font-weight: 600; font-size: .92rem; box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .5); transition: transform .45s var(--ease); z-index: 40; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
