/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; transition: .15s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); transform: translateY(-1px); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: #e0e4ff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--gray-soft); }

/* Cards & stats */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.card-body { padding: 18px 20px; }
.card:not(:has(.card-head)) > .card-body:has(.table-wrap) { padding: 0; }
.card.narrow { max-width: 620px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-header p { margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 21px; letter-spacing: -.02em; white-space: nowrap; }
.stat-hint { font-size: 12px; color: var(--muted); }
.stat-indigo .stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-violet .stat-icon { background: var(--violet-soft); color: var(--violet); }
.stat-gray .stat-icon { background: var(--gray-soft); color: var(--muted); }
.stat-row .stat { box-shadow: none; padding: 14px; }
.stat-row .stat-value { font-size: 17px; }

/* Badges & avatar */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-gray { background: var(--gray-soft); color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; color: var(--primary); background: var(--primary-soft); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user strong, .cell-user small { display: block; line-height: 1.3; }
.sub { display: block; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .badge { margin-left: auto; }

/* Tables */
.table-wrap { display: flex; flex-direction: column; }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.toolbar-extra { display: flex; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); min-width: 240px; }
.search input[type=search] { border: 0; background: transparent; outline: 0; padding: 9px 0; width: 100%; box-shadow: none; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 11px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--primary); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table th.right, .table td.right { text-align: right; }
.table .total-row td { font-weight: 700; background: var(--primary-soft); }
.row-actions { display: inline-flex; gap: 6px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.pager-btns { display: flex; align-items: center; gap: 10px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; font-weight: 600; }
.field-label i { color: var(--red); font-style: normal; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: 0; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 500; }
.info-box { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: #3730a3; }
.info-box p { margin-top: 2px; font-size: 13px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; }
.inline-field select { width: auto; }
.filters { display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(15, 18, 42, .55); backdrop-filter: blur(3px); animation: fade-in .15s; }
.modal-overlay.leaving { opacity: 0; transition: .15s; }
.modal { width: 100%; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: fade-up .2s; }
.modal-sm { max-width: 440px; } .modal-md { max-width: 600px; } .modal-lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal .table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
@keyframes fade-in { from { opacity: 0; } }

/* Tabs, detail lists */
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 12px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); }
.tab-body { padding-top: 16px; }
.card .tabs + .tab-body { padding-top: 0; }
.modal-body .tabs { padding: 0; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; padding: 14px 16px; background: var(--surface-2); border-radius: 12px; }
.detail-list dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 500; }

/* Toast */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 12px; color: #fff; font-weight: 500; background: #1f2547; box-shadow: var(--shadow-lg); animation: fade-up .25s; }
.toast-success { background: #0f8a62; } .toast-error { background: #c9303c; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: .3s; }

/* Responsive tables become stacked cards on phones */
@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .table td[colspan] { display: block; }
  .detail-list { grid-template-columns: 1fr; }
}

/* Photos */
.photo { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; background: var(--gray-soft); cursor: zoom-in; display: block; }
.photo.broken { opacity: .4; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip .photo { width: 72px; height: 72px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 8px 0; }
.photo-tile { position: relative; aspect-ratio: 1; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(21, 26, 48, .75); color: #fff; display: grid; place-items: center; }
.photo-del:hover { background: var(--red); }
.photo-add { aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; }
.photo-add:hover { border-color: var(--primary); color: var(--primary); }
.lightbox .photo { height: auto; max-height: 70vh; object-fit: contain; cursor: default; }
.lightbox-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; }

/* Visit sheet */
.visit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.visit-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); align-content: start; }
.visit-head { display: flex; align-items: center; gap: 10px; }
.visit-who { flex: 1; min-width: 0; }
.visit-who strong, .visit-who small { display: block; }
.visit-address { margin: 0; color: var(--muted); font-size: 13px; }
.visit-loan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.visit-loan small, .visit-loan strong { display: block; }
.visit-loan strong { font-size: 13px; }
.text-red { color: var(--red); }
.stop-info.clickable { cursor: pointer; }
.stop-info.clickable:hover strong { color: var(--primary); }
.stop-hint { font-weight: 500; font-size: 12px; color: var(--primary); opacity: 0; transition: .15s; }
.stop-info.clickable:hover .stop-hint { opacity: 1; }

/* Early collection */
.early-list { display: grid; gap: 10px; }
.early-item { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, white); }
.early-main { flex: 1; min-width: 220px; }
.early-main strong, .early-main small { display: block; }
.early-note { margin: 4px 0 0; font-style: italic; color: #8a5a06; }
.early-amount { text-align: right; }
.early-amount strong, .early-amount small { display: block; }

.check-field { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check-field input { width: 18px; height: 18px; accent-color: var(--primary); }
.login-note { display: block; margin-top: 14px; color: var(--muted); }

/* Filter chips */
.filter-bar { display: grid; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-label { min-width: 56px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chip { --c: var(--primary); display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13px; transition: .15s; }
.chip:hover { border-color: var(--c); color: var(--c); }
.chip.active { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 35%, transparent); }
.chip b { font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); }
.chip.active b { background: rgba(255, 255, 255, .25); color: #fff; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip.active .chip-dot { background: #fff; }
.check-item.disabled { opacity: .6; cursor: not-allowed; }
.modal .check-list { max-height: 300px; }

.avatar.has-photo { background-size: cover; background-position: center; }
.photo-grid.small { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.profile-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-card .avatar { width: 110px; height: 110px; font-size: 34px; }
.user-chip.clickable { cursor: pointer; }
.user-chip.clickable:hover strong { text-decoration: underline; }
.review-note { display: block; max-width: 260px; white-space: normal; }
.table .photo-strip { flex-wrap: nowrap; }
.table .photo-strip .photo { width: 48px; height: 48px; flex: none; }

/* Collection success animation */
.success-overlay { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(circle at 50% 40%, rgba(34, 40, 110, .96), rgba(14, 17, 48, .98)); color: #fff; animation: fade-in .2s; cursor: pointer; }
.success-overlay.leaving { opacity: 0; transition: opacity .2s; }
.success-burst { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.success-check { width: 130px; height: 130px; position: relative; z-index: 2; display: block; }
.sc-circle { stroke: #12d6a0; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; stroke-linecap: round; animation: sc-draw .6s .1s ease forwards; transform-origin: center; }
.sc-tick { stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: sc-draw .4s .65s ease forwards; }
.success-ring { position: absolute; inset: 10px; border-radius: 50%; background: rgba(18, 214, 160, .18); animation: sc-pop .7s .55s ease-out both; }
.success-ring.r2 { animation-delay: .75s; background: rgba(99, 102, 241, .2); }
.success-confetti { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.confetti { position: absolute; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: confetti 1.5s var(--d) .6s cubic-bezier(.2, .7, .3, 1) forwards; }
.success-text { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; animation: fade-up .5s .8s both; }
.success-text strong { font-size: 26px; letter-spacing: -.02em; }
.success-amount { font-size: 38px; font-weight: 700; color: #5eead4; letter-spacing: -.03em; }
.success-text small { color: #b5baea; font-size: 14px; }
@keyframes sc-draw { to { stroke-dashoffset: 0; } }
@keyframes sc-pop { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 220px)) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) { .confetti, .success-ring { display: none; } }

.section-title { margin: 0 0 10px; font-size: 14px; }
.payout-calc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.payout-calc strong { font-size: 16px; padding: 3px 12px; border-radius: 99px; background: #fff; }

.payout-strip { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.payout-strip > div { flex: 1; min-width: 160px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.payout-strip small, .payout-strip strong { display: block; }
.payout-strip strong { font-size: 20px; letter-spacing: -.02em; }
.payout-strip .payout-final { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, white); }
.payout-strip .payout-final strong { color: var(--green); }

.perm-cell { text-align: center; width: 110px; }
.perm-group td { padding-top: 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.perm-group-title { margin: 8px 0 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.perm-user-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.perm-user-row small { display: block; }
.perm-user-row select { flex: none; width: auto; min-width: 130px; }
.perm-box { display: inline-flex; padding: 6px; cursor: pointer; }
.perm-box input { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }

/* Logo / install */
.brand-mark.has-logo { background: #fff; padding: 4px; box-shadow: none; }
.brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark.big.has-logo { background: rgba(255, 255, 255, .95); padding: 8px; }
.logo-row { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 150px; height: 110px; display: grid; place-items: center; text-align: center; padding: 8px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); font-size: 12px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.icon-previews { display: flex; gap: 16px; }
.icon-previews figure { margin: 0; text-align: center; }
.icon-previews img { border-radius: 16px; box-shadow: var(--shadow); display: block; }
.icon-previews figcaption { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border-radius: 8px; cursor: pointer; }
.topbar-install { display: none; }
.install-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 16px; color: #fff; background: linear-gradient(120deg, #3b36c9, #7c5cf5); box-shadow: 0 14px 30px rgba(79, 70, 229, .28); }
.install-banner-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.install-banner-text { flex: 1; min-width: 200px; }
.install-banner-text strong, .install-banner-text small { display: block; }
.install-banner-text small { color: rgba(255, 255, 255, .85); }
.install-banner .btn-primary { background: #fff; color: var(--primary); box-shadow: none; }
.install-banner .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .4); }

/* Install tour illustrations */
.tour { text-align: center; }
.tour h4 { margin: 4px 0 0; font-size: 17px; }
.tour p { margin: 0; }
.tour-scene { display: grid; place-items: center; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.tour-dots { display: flex; gap: 6px; justify-content: center; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all .2s; }
.tour-dots i.on { width: 22px; border-radius: 6px; background: var(--primary); }
.tour-phone { position: relative; width: 230px; height: 260px; overflow: hidden; border-radius: 22px; border: 6px solid #1f2230; background: #fff; text-align: left; font-size: 11px; color: #1f2230; }
.tour-wide { width: 100%; max-width: 330px; border-radius: 12px; border-width: 4px; }
.tour-url { position: relative; display: flex; align-items: center; justify-content: space-between; margin: 10px; padding: 7px 10px; border-radius: 12px; background: #e9eaf0; }
.tour-url-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5b6075; }
.tour-share { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; }
.tour-page { padding: 8px 14px; display: grid; gap: 10px; }
.tour-page i { height: 12px; border-radius: 6px; background: #eceef4; }
.tour-page i:first-child { height: 70px; border-radius: 12px; background: linear-gradient(120deg, #3b36c9, #7c5cf5); }
.tour-sheet { position: absolute; inset: 14px 8px 0; padding: 10px; border-radius: 18px 18px 0 0; background: #f2f3f7; box-shadow: 0 -4px 20px rgba(0, 0, 0, .12); overflow: hidden; }
.tour-sheet-head { display: flex; gap: 8px; align-items: center; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #dfe1e9; }
.tour-sheet-head small { display: block; color: #7a8095; font-size: 9px; }
.tour-thumb { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; flex: none; }
.tour-apps { display: flex; justify-content: space-between; margin-bottom: 10px; }
.tour-act { width: 46px; text-align: center; border-radius: 10px; }
.tour-act small { display: block; margin-top: 3px; font-size: 8px; line-height: 1.15; }
.tour-act-icon { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; background: #dfe1e9; font-size: 15px; }
.tour-act-icon.tour-app { border-radius: 9px; background: #8aa4f5; }
.tour-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; background: #fff; border-bottom: 1px solid #eceef4; }
.tour-row-dot { width: 12px; height: 12px; border-radius: 3px; background: #c8ccdb; flex: none; }
.tour-gap { height: 8px; }
.tour-scroll { display: grid; gap: 1px; animation: tour-scroll 2.6s ease-in-out infinite; }
.tour-menu { position: absolute; top: 44px; right: 8px; left: 50px; display: grid; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .22); }
.tour-add { inset: 40px 8px 0; background: #fff; }
.tour-add-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; color: #7a8095; }
.tour-add-head strong { color: #1f2230; }
.tour-add-btn { padding: 4px 12px; border-radius: 14px; background: #eceef4; color: var(--primary); font-weight: 700; }
.tour-add-body { display: grid; gap: 8px; justify-items: center; padding: 14px 0; }
.tour-app-icon { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; }
.tour-hot { position: relative; z-index: 1; border-radius: 12px; box-shadow: 0 0 0 3px var(--primary), 0 0 0 8px rgba(79, 70, 229, .25); animation: tour-pulse 1.4s ease-in-out infinite; }
.tour-tap { position: absolute; z-index: 2; padding: 3px 9px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; font-size: 11px; white-space: nowrap; animation: tour-bob 1.1s ease-in-out infinite; }
.tour-tap::before { content: ''; position: absolute; left: 50%; top: -5px; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: var(--primary); }
.tour-tap-below-right { top: 40px; right: 6px; }
.tour-tap-below-right::before { left: auto; right: 14px; margin: 0; }
.tour-tap-swipe { top: 6px; left: 50%; transform: translateX(-50%); }
.tour-tap-swipe::before { display: none; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 3px var(--primary), 0 0 0 12px rgba(79, 70, 229, .08); } }
@keyframes tour-bob { 50% { translate: 0 4px; } }
@keyframes tour-scroll { 0%, 25% { transform: translateY(0); } 70%, 100% { transform: translateY(-40px); } }
@media (prefers-reduced-motion: reduce) { .tour-hot, .tour-tap, .tour-scroll { animation: none; } }

/* Phones & tablets: no iOS zoom on focus, notch-safe edges, larger touch targets, standalone feel */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 960px) {
  input:not([type=checkbox]):not([type=color]), select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .topbar-install { display: inline-flex; }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
  .sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .toast-host { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) { .topbar-install { display: none; } }

.server-warning { position: fixed; z-index: 400; top: 0; left: 0; right: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #b4232c; color: #fff; font-size: 13px; }
.server-warning button { flex: none; border: 1px solid rgba(255, 255, 255, .5); background: none; color: #fff; border-radius: 8px; padding: 5px 12px; }
.warn-box { background: var(--amber-soft); color: #8a5a06; }

.name-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.name-chip { padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--text); white-space: nowrap; }
.name-chip.due { background: var(--red-soft); color: var(--red); }
.name-chip.more { background: transparent; color: var(--muted); border: 1px dashed var(--border); }
.center-title { min-width: 0; flex: 1 1 260px; }

/* Receipts & printer */
.receipt-settings { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .receipt-settings { grid-template-columns: 1fr; } }
.receipt-paper { display: grid; place-items: start center; padding: 18px; background: #e9ebf5; border-radius: 14px; }
.receipt-paper.sticky { position: sticky; top: 84px; }
.receipt-img { width: 100%; max-width: 288px; background: #fff; box-shadow: 0 6px 24px rgba(21, 26, 48, .18); image-rendering: auto; }
.receipt-status { padding: 10px 12px; border-radius: 10px; background: var(--gray-soft); font-weight: 500; }
.receipt-status.ok { background: var(--green-soft); color: var(--green); }
.receipt-status.error { background: var(--red-soft); color: var(--red); }
.printer-status { display: flex; align-items: center; gap: 12px; }
.printer-status strong, .printer-status small { display: block; }
.printer-status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); flex: none; }
.printer-status .dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.printer-hint { background: linear-gradient(120deg, #0f8a62, #12a373); box-shadow: 0 14px 30px rgba(18, 163, 115, .25); }
.printer-hint .btn-primary { background: #fff; color: #0f8a62; }

/* Narrow screens: controls wrap instead of running off the card */
.row-actions { flex-wrap: wrap; }
.inline-field { flex-wrap: wrap; max-width: 100%; }
.inline-field select { max-width: 100%; min-width: 0; flex: 1 1 200px; }
.printer-status > div { min-width: 0; }

/* ======== Agent app: modern, animated ======== */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal .55s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms) both; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } .a-blob { animation: none !important; } }

.a-hero { position: relative; overflow: hidden; padding: 22px; border-radius: 26px; color: #fff; background: linear-gradient(135deg, #2f2a9e 0%, #5b3df0 55%, #8b5cf6 100%); box-shadow: 0 22px 44px rgba(79, 70, 229, .32); }
.a-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; animation: float 9s ease-in-out infinite; }
.a-blob.b1 { width: 220px; height: 220px; right: -60px; top: -80px; background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 70%); }
.a-blob.b2 { width: 160px; height: 160px; left: -40px; bottom: -70px; background: radial-gradient(circle, rgba(18, 214, 160, .45), transparent 70%); animation-delay: -4s; }
@keyframes float { 50% { transform: translate(14px, -10px) scale(1.06); } }
.a-hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.a-hero-text { min-width: 0; }
.a-greet { display: block; font-size: 13px; opacity: .8; }
.a-hero h1 { font-size: 28px; letter-spacing: -.02em; margin: 2px 0 4px; color: #fff; }
.a-date { display: block; font-size: 13px; opacity: .8; }
.a-hero-msg { margin-top: 12px; display: inline-block; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); font-size: 13px; font-weight: 600; }
.a-ring { position: relative; flex: none; }
.a-ring svg { display: block; }
.a-ring .ring-arc { transition: stroke-dasharray 1.3s cubic-bezier(.2, .8, .2, 1); }
.a-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.a-ring-pct { font-size: 30px; letter-spacing: -.03em; }
.a-ring-center small { font-size: 11px; opacity: .8; }
.a-ring.brand { color: var(--text); }
.a-pills { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.a-pill { padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .15); backdrop-filter: blur(8px); min-width: 0; }
.a-pill small { display: block; font-size: 11px; opacity: .8; white-space: nowrap; }
.a-pill strong { display: block; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.a-pill.good strong { color: #7df2c6; }
.a-pill.warn strong { color: #ffd37a; }
@media (max-width: 420px) { .a-pills { grid-template-columns: 1fr 1fr; } .a-pill:last-child { grid-column: 1 / -1; } .a-hero h1 { font-size: 24px; } }

.a-next { display: grid; gap: 10px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.a-next::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #4f46e5, #12a373); }
.a-next-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.a-next-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.a-next-body strong, .a-next-body small { display: block; }
.a-next-body strong { font-size: 19px; }
.a-next .btn { animation: pulse-ring 2.4s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); } 70% { box-shadow: 0 0 0 14px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }

.a-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .a-tiles { grid-template-columns: repeat(2, 1fr); } }
.a-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .15s, box-shadow .15s; }
.a-tile:active { transform: scale(.96); }
.a-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(21, 26, 48, .12); }
.a-tile strong { font-size: 15px; }
.a-tile small { color: var(--muted); font-size: 12px; }
.a-tile-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 6px; }
.t-indigo .a-tile-icon { background: var(--primary-soft); color: var(--primary); }
.t-blue .a-tile-icon { background: var(--blue-soft); color: var(--blue); }
.t-green .a-tile-icon { background: var(--green-soft); color: var(--green); }
.t-violet .a-tile-icon { background: var(--violet-soft); color: var(--violet); }

.a-stops { display: grid; gap: 12px; }
.a-stop { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); border-left: 5px solid var(--c); transition: transform .15s; }
.a-stop:hover { transform: translateX(2px); }
.a-stop.done { background: color-mix(in srgb, var(--green) 6%, white); border-left-color: var(--green); }
.a-stop-no { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 40%, transparent); }
.a-stop.done .a-stop-no { background: var(--green); animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.a-stop-main { flex: 1; min-width: 0; cursor: pointer; display: grid; gap: 6px; }
.a-stop-title { display: flex; align-items: center; gap: 8px; }
.a-stop-title strong { font-size: 16px; }
.a-done-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.a-stop-names { display: flex; flex-wrap: wrap; gap: 5px; }
.a-bar { height: 7px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.a-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--c, #4f46e5), #12a373); animation: fill 1.1s .25s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes fill { to { width: var(--w); } }

.a-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 12px; text-align: center; color: var(--muted); }
.a-empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; animation: float 4s ease-in-out infinite; }
.a-empty strong { color: var(--text); font-size: 16px; }
.a-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-mini > div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.a-mini small, .a-mini strong { display: block; }
.a-mini strong { font-size: 17px; }

/* Agent collections */
.a-hero.compact { padding: 18px 20px; }
.a-hero.compact h1 { font-size: 26px; margin-bottom: 8px; }
.a-collect-nums { display: flex; gap: 22px; }
.a-collect-nums small, .a-collect-nums strong { display: block; }
.a-collect-nums small { font-size: 11px; opacity: .8; }
.a-collect-nums strong { font-size: 20px; letter-spacing: -.02em; }
.a-collect-nums strong.good { color: #7df2c6; }
.a-hero-msg.warn { background: rgba(255, 120, 120, .28); }
.a-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px; border-radius: 18px; background: var(--gray-soft); }
.a-seg-btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 6px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; transition: .2s; }
.a-seg-btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 4px 12px rgba(21, 26, 48, .1); }
.a-seg-btn b { min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; background: var(--surface); color: var(--muted); }
.a-seg-btn.active b { background: var(--primary-soft); color: var(--primary); }
.a-seg-btn b.hot { background: var(--red-soft); color: var(--red); }
.a-filters { display: grid; gap: 10px; }
.a-filters .search { min-width: 0; width: 100%; background: var(--surface); }
.a-filters .chip-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.a-filters .chip { flex: none; }
.c-group header { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 10px; }
.c-group header strong { font-size: 16px; }
.c-group header small { margin-left: auto; font-weight: 600; }
.c-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); align-self: center; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.c-cards { display: grid; gap: 10px; }
.c-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .15s; }
.c-card:active { transform: scale(.985); }
.c-card.late { border-color: color-mix(in srgb, var(--red) 35%, white); background: linear-gradient(90deg, color-mix(in srgb, var(--red) 6%, white), var(--surface) 40%); }
.c-card .avatar { width: 46px; height: 46px; font-size: 15px; }
.c-main { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.c-main strong { font-size: 15.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-side { display: grid; gap: 8px; justify-items: end; flex: none; }
.c-amount { font-size: 18px; letter-spacing: -.02em; }
.c-amount.green { color: var(--green); }
.c-actions { display: flex; align-items: center; gap: 8px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.round-btn:active { transform: scale(.92); }
.a-chip { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.a-chip.red { background: var(--red-soft); color: var(--red); }
.a-chip.amber { background: var(--amber-soft); color: var(--amber); }
.a-chip.blue { background: var(--blue-soft); color: var(--blue); }
.paid-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green); }
.a-empty.big { padding: 48px 12px; }
.a-done-check { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #12a373, #5eead4); box-shadow: 0 16px 34px rgba(18, 163, 115, .35); animation: pop .6s cubic-bezier(.2, .9, .3, 1.4); margin-bottom: 8px; }
.a-done-check.soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
@media (max-width: 420px) { .c-card { padding: 12px; gap: 10px; } .c-amount { font-size: 16px; } .c-card .avatar { width: 40px; height: 40px; } }
.a-hero small, .a-hero .a-ring-center small { color: rgba(255, 255, 255, .82); }
.a-hero .a-pill small { color: rgba(255, 255, 255, .8); }
.a-hero strong.count { white-space: nowrap; }
@media (max-width: 420px) { .a-collect-nums { gap: 16px; } .a-collect-nums strong { font-size: 17px; } }

/* ===== Agent: shared pieces for customers / requests / loans ===== */
.a-pills.n2 { grid-template-columns: repeat(2, 1fr); }
.a-pills.n4 { grid-template-columns: repeat(4, 1fr); }
.a-hero-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.a-hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 14px; background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, .15); transition: transform .15s; }
.a-hero-btn:active { transform: scale(.95); }
.a-search { width: 100%; min-width: 0; background: var(--surface); }
.chip-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.a-chip.gray { background: var(--gray-soft); color: var(--muted); }
.a-chip.green { background: var(--green-soft); color: var(--green); }
.a-chip.violet { background: var(--violet-soft); color: var(--violet); }
.c-card.tap { cursor: pointer; }
.c-card.tap:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(21, 26, 48, .1); }
.chev { color: var(--muted); display: grid; place-items: center; }
.a-bar.thick { height: 10px; }
.a-bar.thick i { background: linear-gradient(90deg, #4f46e5, #12a373); }
.l-list { display: grid; gap: 12px; }
.l-card { display: grid; gap: 12px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.l-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(21, 26, 48, .1); }
.l-card.late { border-color: color-mix(in srgb, var(--red) 35%, white); background: linear-gradient(180deg, color-mix(in srgb, var(--red) 5%, white), var(--surface) 55%); }
.l-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.l-who strong, .l-who small { display: block; }
.l-who strong { font-size: 16.5px; }
.l-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.l-nums small, .l-nums strong { display: block; }
.l-nums strong { font-size: 15px; letter-spacing: -.01em; }
.r-card { display: flex; gap: 14px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.r-card.amber { border-left: 5px solid var(--amber); } .r-card.green { border-left: 5px solid var(--green); } .r-card.red { border-left: 5px solid var(--red); }
.r-icon { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.r-icon.amber { background: var(--amber-soft); color: var(--amber); } .r-icon.green { background: var(--green-soft); color: var(--green); } .r-icon.red { background: var(--red-soft); color: var(--red); }
.r-icon.pulse { animation: pulse-amber 2s infinite; }
@keyframes pulse-amber { 0% { box-shadow: 0 0 0 0 rgba(217, 138, 11, .45); } 70% { box-shadow: 0 0 0 12px rgba(217, 138, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 138, 11, 0); } }
.r-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.r-head strong { font-size: 16px; }
.r-amounts { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 2px; }
.r-amounts small, .r-amounts strong { display: block; }
.r-amounts strong { font-size: 16px; }
.r-amounts .neg { color: var(--red); } .r-amounts .pos { color: var(--green); }
.sheet-profile { display: flex; align-items: center; gap: 14px; }
.sheet-profile .avatar { width: 64px; height: 64px; font-size: 22px; }
.sheet-profile h3 { font-size: 20px; }
.sheet-actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-actions-row .btn { flex: 1; min-width: 130px; }

.profile-hero-avatar .avatar { width: 96px; height: 96px; font-size: 32px; border: 4px solid rgba(255, 255, 255, .6); box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.printer-badge { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); color: #fff; }
.printer-badge.ok { background: linear-gradient(135deg, #12a373, #5eead4); animation: pop .6s; }
.stack, .a-home, .a-filters { min-width: 0; }
.stack > *, .a-filters > * { min-width: 0; max-width: 100%; }
.a-hero.compact h1 { font-size: 24px; }
@media (max-width: 420px) {
  .a-seg-btn { font-size: 12.5px; gap: 4px; padding: 10px 2px; }
  .a-seg-btn b { padding: 0 6px; min-width: 18px; font-size: 11px; }
}

/* ======== Admin screens: headers, KPIs, motion ======== */
.page-header { align-items: center; margin-bottom: 2px; }
.ph-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #4f46e5, #8b5cf6); box-shadow: 0 10px 22px rgba(79, 70, 229, .32); animation: pop .5s cubic-bezier(.2, .9, .3, 1.3); }
.page-header h1 { font-size: 26px; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .04; }
.stat-icon { transition: transform .25s; }
.stat:hover .stat-icon { transform: rotate(-6deg) scale(1.08); }

/* Entrance: blocks of an admin page rise in one after another; table rows fade in */
.page > .stack:not(.a-home) > * { animation: reveal .5s cubic-bezier(.2, .8, .2, 1) both; }
.page > .stack:not(.a-home) > *:nth-child(2) { animation-delay: 60ms; }
.page > .stack:not(.a-home) > *:nth-child(3) { animation-delay: 120ms; }
.page > .stack:not(.a-home) > *:nth-child(4) { animation-delay: 180ms; }
.page > .stack:not(.a-home) > *:nth-child(5) { animation-delay: 240ms; }
.page > .stack:not(.a-home) > *:nth-child(n+6) { animation-delay: 300ms; }
.table tbody tr { animation: row-in .4s ease both; }
.table tbody tr:nth-child(1) { animation-delay: 30ms; } .table tbody tr:nth-child(2) { animation-delay: 60ms; } .table tbody tr:nth-child(3) { animation-delay: 90ms; }
.table tbody tr:nth-child(4) { animation-delay: 120ms; } .table tbody tr:nth-child(5) { animation-delay: 150ms; } .table tbody tr:nth-child(n+6) { animation-delay: 180ms; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } }
.card { transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 14px 34px rgba(21, 26, 48, .09); }
.table tr.clickable:hover td { background: var(--primary-soft); }
.table td { transition: background .15s; }
.btn { transition: transform .15s, box-shadow .15s, background .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.modal { animation: modal-in .28s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* Tabs as a pill switcher */
.tabs { display: inline-flex; gap: 4px; padding: 5px; margin: 0 0 14px; border: 0; border-radius: 16px; background: var(--gray-soft); max-width: 100%; }
.tab { padding: 9px 16px; border: 0; border-radius: 12px; font-size: 13.5px; transition: background .2s, color .2s, box-shadow .2s; }
.tab.active { background: var(--surface); color: var(--primary); border: 0; box-shadow: 0 4px 12px rgba(21, 26, 48, .1); }
.tab-body { padding-top: 0; }
.modal-body .tabs { margin-bottom: 10px; }
.card .tabs { margin: 14px 16px 6px; }

/* Approvals as cards */
.approval-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.approval-card { display: grid; gap: 14px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-top: 4px solid var(--amber); transition: transform .2s, box-shadow .2s; }
.approval-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(21, 26, 48, .12); }
.approval-head { display: flex; align-items: center; gap: 12px; }
.approval-head .avatar { width: 52px; height: 52px; font-size: 17px; }
.approval-head strong, .approval-head small { display: block; }
.approval-head strong { font-size: 17px; }
.approval-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.approval-facts small, .approval-facts b { display: block; }
.approval-facts b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.approval-actions { display: flex; gap: 10px; }
.approval-actions .btn { flex: 1; }
.approval-card.leaving { animation: card-out .35s forwards; }
@keyframes card-out { to { opacity: 0; transform: scale(.92) translateY(-8px); } }

/* Progress bar inside tables */
.mini-progress { display: grid; gap: 4px; min-width: 110px; }
.mini-progress small { font-size: 11.5px; }
.mini-progress .a-bar { height: 7px; }

/* Dashboard 2.0 */
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.attn { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .2s, box-shadow .2s; }
.attn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(21, 26, 48, .12); }
.attn .stat-icon { width: 46px; height: 46px; }
.attn strong { font-size: 24px; letter-spacing: -.02em; display: block; line-height: 1.1; }
.attn small { display: block; }
.attn.hot { border-color: color-mix(in srgb, var(--c) 40%, white); background: linear-gradient(120deg, color-mix(in srgb, var(--c) 8%, white), var(--surface) 55%); }
.attn.hot .stat-icon { animation: pulse-soft 2.4s infinite; }
@keyframes pulse-soft { 50% { transform: scale(1.1); } }
.all-clear { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 20px; background: linear-gradient(120deg, var(--green-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 25%, white); color: var(--green); font-weight: 600; }
.feed { display: grid; gap: 2px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; animation: row-in .4s both; }
.feed-item:hover { background: var(--surface-2); }
.feed-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.feed-main { flex: 1; min-width: 0; }
.feed-main strong, .feed-main small { display: block; }
.feed-amount { font-weight: 700; color: var(--green); white-space: nowrap; }
.hbar-fill { width: 0; animation: grow 1s .2s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes grow { to { width: var(--w, 100%); } }
.login-video-preview { width: 100%; max-height: 220px; border-radius: 14px; background: #000; }

/* ======== Customer app ======== */
.cu-next { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; flex-wrap: wrap; }
.cu-next::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--blue); }
.cu-next.amber::before { background: var(--amber); } .cu-next.late::before { background: var(--red); }
.cu-next.late { border-color: color-mix(in srgb, var(--red) 40%, white); background: linear-gradient(110deg, color-mix(in srgb, var(--red) 7%, white), var(--surface) 55%); }
.cu-next.amber { animation: nudge 3s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 22%, transparent), var(--shadow); } }
.cu-cal { width: 62px; flex: none; text-align: center; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 6px 14px rgba(21, 26, 48, .1); animation: pop .6s cubic-bezier(.2, .9, .3, 1.3); }
.cu-cal small { display: block; padding: 3px 0; background: var(--red); color: #fff; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.cu-cal strong { display: block; font-size: 28px; padding: 4px 0 6px; letter-spacing: -.03em; }
.cu-next-main { flex: 1; min-width: 160px; display: grid; gap: 4px; justify-items: start; }
.cu-next-main small { color: var(--muted); font-weight: 600; }
.cu-next-amount { font-size: 30px; letter-spacing: -.03em; }
.cu-next-note { width: 100%; font-size: 13px; color: var(--muted); }
.cu-alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; color: #7a1219; background: linear-gradient(110deg, #fde9eb, #fff4f5); border: 1px solid color-mix(in srgb, var(--red) 30%, white); }
.cu-alert > div:nth-child(2) { flex: 1; min-width: 0; } .cu-alert strong, .cu-alert small { display: block; } .cu-alert small { color: #9b3a42; }
.cu-alert-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; animation: pulse-red 2s infinite; flex: none; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(224, 67, 79, .5); } 70% { box-shadow: 0 0 0 14px rgba(224, 67, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 67, 79, 0); } }
.cu-call { background: var(--red); color: #fff; }
.cu-card { display: grid; gap: 14px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.cu-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cu-card-head strong { font-size: 16px; }
.cu-link { border: 0; background: none; color: var(--primary); font-weight: 700; }
.cu-dots { display: flex; flex-wrap: wrap; gap: 9px; }
.cu-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--gray-soft); color: var(--muted); animation: dot-in .5s calc(var(--i) * 60ms + .3s) cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes dot-in { from { opacity: 0; transform: scale(.2); } }
.cu-dot.paid { background: linear-gradient(135deg, #12a373, #5eead4); color: #fff; box-shadow: 0 6px 12px rgba(18, 163, 115, .3); }
.cu-dot.next { background: var(--primary); color: #fff; animation: dot-in .5s calc(var(--i) * 60ms + .3s) both, pulse-dot2 2s 1.5s infinite; }
.cu-dot.late { background: var(--red); color: #fff; }
@keyframes pulse-dot2 { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .5); } 70% { box-shadow: 0 0 0 11px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }
.cu-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.cu-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cu-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-soft); }
.cu-legend i.paid { background: #12a373; } .cu-legend i.next { background: var(--primary); } .cu-legend i.late { background: var(--red); }
.cu-agent { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.cu-agent > div { flex: 1; } .cu-agent strong, .cu-agent small { display: block; }
.cu-topup { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, #6d4df2, #a37bff); box-shadow: 0 14px 30px rgba(109, 77, 242, .3); }
.cu-topup small { display: block; color: rgba(255, 255, 255, .85); } .cu-topup strong { font-size: 16px; }
.cu-topup-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; animation: float 4s ease-in-out infinite; }
.cu-done { position: relative; overflow: hidden; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 34px 20px; border-radius: 24px; background: linear-gradient(135deg, var(--green-soft), #fff); border: 1px solid color-mix(in srgb, var(--green) 25%, white); }
.cu-done strong { font-size: 20px; } .cu-done small { color: var(--muted); max-width: 300px; }
.cu-confetti i { position: absolute; top: -10px; left: calc(var(--i) * 7.2%); width: 8px; height: 14px; border-radius: 2px; background: hsl(calc(var(--i) * 26), 80%, 60%); animation: fall 3.2s calc(var(--i) * 120ms) ease-in infinite; }
@keyframes fall { to { transform: translateY(230px) rotate(540deg); opacity: 0; } }
/* instalments timeline */
.cu-timeline { display: grid; gap: 18px; }
.cu-month h4 { margin: 0 4px 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cu-steps { position: relative; display: grid; gap: 10px; }
.cu-steps::before { content: ''; position: absolute; left: 21px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: var(--gray-soft); }
.cu-step { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.cu-step.current { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12), var(--shadow); }
.cu-step.red { border-color: color-mix(in srgb, var(--red) 35%, white); }
.cu-step-node { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-soft); color: var(--blue); font-weight: 700; z-index: 1; border: 3px solid var(--surface); }
.cu-step.green .cu-step-node { background: linear-gradient(135deg, #12a373, #5eead4); color: #fff; }
.cu-step.red .cu-step-node { background: var(--red-soft); color: var(--red); } .cu-step.amber .cu-step-node { background: var(--amber-soft); color: var(--amber); }
.cu-step.current .cu-step-node { background: var(--primary); color: #fff; animation: pulse-dot2 2s infinite; }
.cu-step-main { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.cu-step-main strong { font-size: 15px; }
.cu-step-amount { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.cu-step-amount.green { color: var(--green); }

/* Visit outcome picker */
.visit-choices { display: grid; gap: 8px; }
.visit-choice { display: grid; gap: 2px; text-align: left; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.visit-choice small { color: var(--muted); }
.visit-choice.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.a-chip.visited { margin-left: 6px; }
.visit-told { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--border); }
.visit-told.today { border-left-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.visit-told p { margin: 0; font-size: 13px; } .visit-told .visit-note { color: var(--muted); font-style: italic; }
.visit-choice[role=radio]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cu-step.gray .cu-step-node { background: var(--surface-2); color: var(--muted); }

/* Visit counter */
.visit-count { display: block; color: var(--muted); font-weight: 600; }
.visit-count-box { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.visit-count-box[hidden] { display: none; }
.visit-count-box strong { color: var(--primary); }
.visit-count-box small { color: var(--muted); }
.visit-history { display: grid; gap: 8px; }
.visit-history .section-title { margin: 0; }
.visit-log { display: grid; gap: 6px; }
.visit-log-row { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.visit-log-row .visit-note { color: var(--muted); font-style: italic; }

/* Daily agent report */
.rep { display: grid; gap: 16px; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rep-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.rep-tile small { color: var(--muted); font-weight: 600; }
.rep-tile strong { font-size: 18px; }
.rep-tile.good strong { color: var(--green); }
.rep-tile.warn strong { color: var(--amber); }
.rep-tile.strong { background: var(--primary); }
.rep-tile.strong small, .rep-tile.strong strong { color: #fff; }
.rep-section { display: grid; gap: 8px; }
.rep-section h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.rep-section h4 span { padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.rep-list { display: grid; gap: 6px; }
.rep-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 0; text-align: left; color: inherit; font: inherit; }
button.rep-row { cursor: pointer; width: 100%; }
.rep-row.on { outline: 2px solid var(--primary); }
.rep-main, .rep-side { display: grid; gap: 2px; min-width: 0; }
.rep-side { justify-items: end; text-align: right; flex: none; }
.rep-main small, .rep-side small { color: var(--muted); }
.rep-note { font-style: italic; }
.rep-side .green { color: var(--green); }
.rep-empty { margin: 0; }
.rep-cash { display: grid; gap: 4px; }
.rep-line { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); }
.rep-line.strong { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); font-size: 16px; }
.rep-actions { flex-wrap: wrap; }
.rep-date input { padding: 8px 10px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .92); color: #1f2230; font-weight: 700; }

/* Cash handover */
.handover-diff { padding: 10px 14px; border-radius: 12px; font-weight: 700; background: var(--surface-2); grid-column: 1 / -1; }
.handover-diff.ok { background: var(--green-soft); color: var(--green); }
.handover-diff.short { background: var(--amber-soft); color: var(--amber); }
.handover-diff.over { background: var(--blue-soft); color: var(--blue); }
.handover-done { display: grid; gap: 6px; }
.rep-tile.info strong { color: var(--blue); }
.form-grid > .stack { grid-column: 1 / -1; }

/* Android one-tap install sheet */
.install-sheet { position: fixed; z-index: 300; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 14px 16px; border-radius: 20px; color: #fff; background: linear-gradient(120deg, #3b36c9, #7c5cf5); box-shadow: 0 18px 44px rgba(41, 36, 150, .45); transform: translateY(30px); opacity: 0; transition: transform .25s, opacity .25s; max-width: 520px; margin: 0 auto; }
.install-sheet.show { transform: none; opacity: 1; }
.install-sheet-icon img { display: block; border-radius: 12px; background: #fff; }
.install-sheet-text { display: grid; gap: 2px; }
.install-sheet-text small { color: rgba(255, 255, 255, .85); }
.install-sheet-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.install-sheet-actions .btn-primary { flex: 1; background: #fff; color: var(--primary); box-shadow: none; }
.install-sheet-actions .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .4); }
body:not(.touch-nav) .install-sheet { bottom: 20px; }

/* ======== Offline: connection badge, sync button, status strip, sync panel ======== */
.sync-control { display: inline-flex; align-items: center; gap: 8px; }
.sync-badge { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: .15s; }
.sync-badge:hover { box-shadow: var(--shadow); }
.sync-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--gray-soft); color: var(--muted); }
.sync-dot.big { width: 44px; height: 44px; }
.sync-dot.spin .icon, .sync-btn.spin .icon { animation: spin .9s linear infinite; }
.sync-btn.spin { background: var(--primary-soft); box-shadow: 0 0 0 4px rgba(79, 70, 229, .14); }
.sync-control.on-dark .sync-btn.spin { background: rgba(255, 255, 255, .3); box-shadow: 0 0 0 4px rgba(255, 255, 255, .14); }
.sync-badge.tone-blue .sync-dot { animation: sync-pulse 1.4s ease-in-out infinite; }
@keyframes sync-pulse { 50% { box-shadow: 0 0 0 5px rgba(46, 124, 246, .18); } }
.tone-green .sync-dot { background: var(--green-soft); color: var(--green); }
.tone-blue .sync-dot { background: var(--blue-soft); color: var(--blue); }
.tone-amber .sync-dot { background: var(--amber-soft); color: var(--amber); }
.tone-red .sync-dot { background: var(--red-soft); color: var(--red); }
.sync-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--primary); transition: .15s; }
.sync-btn:hover:not(:disabled) { background: var(--primary-soft); }
.sync-btn:disabled { cursor: default; }
.sync-control.on-dark .sync-badge, .sync-control.on-dark .sync-btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(6px); }
.sync-control.on-dark .sync-dot { background: rgba(255, 255, 255, .22); color: #fff; }
.a-sync { position: relative; display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.sync-row { display: flex; justify-content: flex-end; }

.sync-strip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 16px; border: 0; font-size: 13px; font-weight: 600; text-align: left; position: sticky; top: 0; z-index: 25; }
.sync-strip em { margin-left: auto; font-style: normal; font-weight: 600; opacity: .8; text-decoration: underline; }
.sync-strip.tone-gray { background: #3b3f55; color: #fff; }
.sync-strip.tone-amber { background: var(--amber-soft); color: #8a5600; }
.sync-strip.tone-red { background: var(--red-soft); color: #a3202b; }
.sync-strip.tone-blue { background: var(--blue-soft); color: #1b57b8; }
.touch-nav .sync-strip { padding-top: calc(8px + env(safe-area-inset-top)); }

.sync-panel { display: grid; gap: 16px; }
.sync-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.sync-hero strong { display: block; font-size: 16px; }
.sync-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.sync-facts div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sync-facts dt { font-size: 12px; color: var(--muted); }
.sync-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; }
.sync-note { font-size: 13px; color: var(--muted); }
.sync-note.warn { color: #a3202b; background: var(--red-soft); padding: 8px 12px; border-radius: 10px; }
.sync-issues { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.sync-issue { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--red-soft); background: #fff8f8; }
.sync-issue p { color: #a3202b; font-size: 13px; margin: 2px 0; }
.sync-auth { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--amber-soft); }
.sync-auth input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); }
.sync-error { color: #a3202b; }
.sync-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 960px) { .topbar .sync-control .sync-label { display: none; } .topbar .sync-badge { padding: 0 6px; } }
/* The top bar carries the control on desktop; phones have no top bar, so their home screens carry it instead. */
body:not(.touch-nav) .a-sync, body:not(.touch-nav) .page-header .sync-control { display: none; }

/* ======== First-time setup screen ======== */
.setup-overlay { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 35%, #3a35b8, #14173f 70%); color: #fff; transition: opacity .3s; }
.setup-overlay.leaving { opacity: 0; }
.setup-card { width: min(360px, 100%); display: grid; gap: 14px; text-align: center; justify-items: center; }
.setup-logo { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); animation: splash-pulse 1.6s ease-in-out infinite; }
.setup-card h2 { font-size: 22px; letter-spacing: -.01em; }
.setup-bar { width: 100%; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.setup-bar i { display: block; height: 100%; width: 4%; border-radius: 8px; background: #a5ffd8; transition: width .35s ease; }
.setup-card small { color: rgba(255, 255, 255, .8); min-height: 18px; }
.setup-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; width: 100%; text-align: left; }
.setup-step { display: flex; align-items: center; gap: 12px; opacity: .55; font-weight: 500; }
.setup-step.now, .setup-step.done { opacity: 1; }
.setup-step .icon, .setup-dot, .setup-spin { width: 20px; height: 20px; flex: none; }
.setup-step.done .icon { color: #7df2c6; }
.setup-dot { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); }
.setup-spin { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
.setup-note { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.setup-fail { background: rgba(224, 67, 79, .9); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
