:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #102033;
  --muted: #667085;
  --line: #e6eaf0;
  --primary: #58c89d;
  --primary-dark: #45ad84;
  --success: #142b50;
  --danger: #c33a3a;
  --warning: #b7791f;
  --shadow: 0 18px 45px rgba(16, 32, 51, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(88,200,157,.65); box-shadow: 0 0 0 4px rgba(88,200,157,.16); }
textarea { min-height: 96px; resize: vertical; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 13px; color: #344054; }
label small { font-weight: 500; color: var(--muted); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 28px; letter-spacing: -0.03em; }
h2 { margin-bottom: 14px; font-size: 20px; letter-spacing: -0.02em; }
h3 { margin-bottom: 6px; }
p, small { color: var(--muted); }
code { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  gap: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(88,200,157,.20), transparent 32%),
    radial-gradient(circle at 90% 5%, rgba(236,0,140,.10), transparent 28%),
    linear-gradient(135deg, #f7fffb, #edf8f3);
}
.auth-card, .auth-panel {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
  align-self: center;
}
.auth-panel {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, #142b50, #10233f);
  color: white;
  overflow: hidden;
  position: relative;
}
.auth-panel:after {
  content: "$";
  position: absolute;
  right: -40px;
  bottom: -95px;
  font-size: 320px;
  opacity: .08;
  font-weight: 900;
}
.auth-panel h2 { font-size: 42px; max-width: 580px; }
.auth-panel li { margin: 16px 0; color: rgba(255,255,255,.82); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-mark {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 16px; background: linear-gradient(135deg, var(--primary), #ec008c); color: white; font-weight: 900; font-size: 26px;
  box-shadow: 0 14px 28px rgba(88,200,157,.26);
}
.brand-mark.small { width: 36px; height: 36px; font-size: 18px; border-radius: 12px; }
.stack { display: grid; gap: 16px; }
.demo-logins { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 8px; }
.demo-login-row {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 12px; display: grid; text-align: left; gap: 2px;
}
.demo-login-row:hover { border-color: var(--primary); }
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: #142b50; color: white; padding: 20px; display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px; margin-bottom: 26px; }
nav { display: grid; gap: 8px; }
.nav-item {
  border: 0; color: rgba(255,255,255,.72); background: transparent; padding: 12px 13px; border-radius: 13px; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: white; color: #142b50; font-weight: 800; }
.side-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; display: grid; gap: 3px; }
.side-footer span { color: rgba(255,255,255,.6); text-transform: capitalize; font-size: 13px; }
.main { min-width: 0; padding: 24px 28px 44px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 22px; }
.topbar p { margin-bottom: 0; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-actions select { min-width: 220px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 8px 28px rgba(16,32,51,.04); margin-bottom: 18px;
}
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin-bottom: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.compact { gap: 10px; }
.narrow { max-width: 860px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: linear-gradient(180deg, white, #fbfcff); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 8px 30px rgba(16,32,51,.05);
}
.kpi span { display: block; color: var(--muted); font-weight: 700; font-size: 13px; }
.kpi strong { display: block; margin: 10px 0 6px; font-size: 30px; letter-spacing: -0.03em; }
.kpi small { display: block; }
.btn {
  border: 0; border-radius: 12px; padding: 11px 15px; background: #e9eef7; color: #102033; font-weight: 800; transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 12px 22px rgba(88,200,157,.26); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); color: white; box-shadow: 0 12px 22px rgba(20,128,74,.18); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.small { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.notice { padding: 13px 15px; border-radius: 15px; margin-bottom: 14px; font-weight: 700; }
.notice.info { background: #eafaf2; color: #142b50; border: 1px solid #c9f1dd; }
.notice.success { background: #eafaf2; color: #176b42; border: 1px solid #c9f1dd; }
.notice.error { background: #fff1f1; color: #9b1c1c; border: 1px solid #ffd5d5; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 760px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #667085; }
tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #eef2f6; color: #344054; font-size: 12px; font-weight: 900; text-transform: capitalize; }
.badge.active, .badge.finalized { background: #dcfce7; color: #166534; }
.badge.inactive, .badge.void, .badge.archived { background: #f1f5f9; color: #64748b; }
.badge.trial, .badge.trialing, .badge.draft { background: #fef3c7; color: #92400e; }
.badge.locked, .badge.submitted { background: #e7faf2; color: #176b42; }
.check { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: auto; }
.template-row { display: grid; grid-template-columns: 1.1fr 1.5fr 120px auto; gap: 10px; align-items: end; margin-bottom: 10px; padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; }
.template-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.template-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fff; }
.template-card ol { padding-left: 20px; margin-bottom: 14px; }
.template-card li { margin: 9px 0; }
.template-card li strong { margin-left: 8px; color: var(--primary); }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.score-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fbfcff; display: grid; gap: 10px; }
.score-card input[type="range"] { padding: 0; }
.score-card input[type="number"] { max-width: 130px; }
.preview-panel { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 14px; background: linear-gradient(135deg, #eef4ff, #effaf5); border: 1px solid #dbe8ff; border-radius: 18px; }
.preview-panel div { background: white; border-radius: 14px; padding: 14px; }
.preview-panel span { display: block; color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.preview-panel strong { display: block; margin-top: 6px; font-size: 20px; }
.score-wrap { min-width: 150px; }
.score-meta { display: flex; justify-content: space-between; font-weight: 900; font-size: 12px; margin-bottom: 5px; }
.score-track { height: 8px; background: #e6eaf0; border-radius: 99px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #ec008c); border-radius: inherit; }
.total-pill { background: #142b50; color: white; border-radius: 999px; padding: 10px 14px; font-weight: 900; }
.empty-state { border: 1px dashed #cbd5e1; border-radius: 18px; padding: 36px 20px; text-align: center; background: #fbfcff; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; margin: 0 auto 12px; background: #eafaf2; color: var(--primary); font-weight: 900; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; gap: 16px; color: var(--muted); }
.loader { width: 34px; height: 34px; border: 4px solid #dbe4f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1080px) {
  .grid.four, .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-panel { min-height: auto; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main { padding: 18px; }
  .topbar { display: grid; }
  .grid.two, .grid.three, .grid.four, .score-grid, .template-list, .preview-panel { grid-template-columns: 1fr; }
  .template-row { grid-template-columns: 1fr; }
}
.btn.accent { background: #142b50; color: white; box-shadow: 0 12px 22px rgba(15,23,42,.20); }
.btn.accent:hover { background: #1f2937; }
.link-button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 8px 0; text-align: center; }
.home-card { max-width: 620px; }
.subscribe-card { max-width: 860px; }
.auth-brand.large h1 { font-size: 36px; }
.hero-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.mini-flow { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 9px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 800; }
.mini-flow span { background: #f8fafc; border: 1px solid var(--line); padding: 8px 10px; border-radius: 999px; }
.fineprint { font-size: 12px; margin-bottom: 0; }
.badge.pending_payment { background: #fef3c7; color: #92400e; }
.badge.past_due { background: #fee2e2; color: #991b1b; }
.badge.canceled { background: #f1f5f9; color: #475569; }
@media (max-width: 640px) { .hero-actions { grid-template-columns: 1fr; } }
/* Production flow updates */
.auth-screen.centered-only {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 36px 18px;
}
.auth-card.centered {
  width: min(100%, 560px);
  align-self: center;
}
.subscribe-card.centered { width: min(100%, 900px); }
.logo-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.logo-block.center {
  justify-content: center;
  text-align: left;
}
.logo-block strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.logo-block span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.auth-title { text-align: center; margin-bottom: 22px; }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 48px; }
.eye-btn {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 16px;
}
.eye-btn:hover { background: #eef2f6; }
.score-card-builder { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fbfcff; display: grid; gap: 14px; }
.scorecard-details summary { cursor: pointer; color: var(--primary); font-weight: 800; }
.scorecard-details ol { margin: 10px 0 0; padding-left: 18px; }
.scorecard-details li { margin: 6px 0; }
.scorecard-details li strong { margin-left: 8px; color: var(--primary); }
.full-width-section { width: 100%; }
.full-width-card { width: 100%; max-width: none; }

/* UI cleanup patch: real icons, modals, and mobile drawer */
.eye-btn svg { display:block; color:#475569; }
.eye-btn:hover svg { color: var(--primary); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .55);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-card {
  width: min(100%, 680px);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15,23,42,.25);
  border: 1px solid var(--line);
  padding: 22px;
}
.modal-card.wide { width: min(100%, 980px); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.modal-head h2 { margin-bottom: 4px; }
.modal-head p { margin-bottom: 0; }
.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
  color: #475569;
}
.modal-close:hover { background: #f8fafc; color: #142b50; }
.score-card-popup ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.score-card-popup li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
}
.score-card-popup small { display:block; margin-top:4px; }
.topbar-title { display:flex; align-items:center; gap:12px; min-width:0; }
.hamburger {
  display:none;
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  place-items:center;
  color:#142b50;
}
.drawer-backdrop { display:none; }
@media (max-width: 820px) {
  .app { display:block; }
  .hamburger { display:grid; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 285px;
    z-index: 90;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 28px 0 60px rgba(15,23,42,.28);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar nav { grid-template-columns: 1fr; }
  .drawer-backdrop.show {
    display:block;
    position:fixed;
    inset:0;
    z-index:85;
    border:0;
    background:rgba(15,23,42,.48);
  }
  .topbar { grid-template-columns: 1fr; align-items: stretch; }
  .top-actions { justify-content: space-between; flex-wrap: wrap; }
  .top-actions select { min-width: 0; flex: 1 1 220px; }
  .main { padding: 16px; }
  .modal-card { padding: 18px; border-radius: 20px; }
  .score-card-popup li { display:grid; }
}


/* Logo and PerformancePay Pro color update */
.app-logo { width: 118px; height: auto; display:block; object-fit:contain; }
.app-logo.compact { width: 76px; }
.logo-block.center { flex-direction: column; text-align:center; gap: 8px; }
.logo-block.center .app-logo { width: 150px; max-width: 70%; }
.side-brand { justify-content:center; margin-bottom: 28px; }
.side-logo { width: 168px; max-width: 100%; height:auto; display:block; }
.btn.primary { background: #58c89d; color: #142b50; box-shadow: 0 12px 22px rgba(88,200,157,.24); }
.btn.primary:hover { background: #45ad84; }
.btn.accent { background: #142b50; color: #fff; box-shadow: 0 12px 22px rgba(20,43,80,.20); }
.btn.accent:hover { background: #0f223f; }
.nav-item.active { background: #58c89d; color: #142b50; font-weight: 900; }
.total-pill { background: #142b50; }
.period-card-list { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.period-card-btn { text-align:left; border:1px solid var(--line); background:#f8fffb; border-radius:16px; padding:14px; display:grid; gap:4px; color:#142b50; }
.period-card-btn:hover { border-color:#58c89d; box-shadow:0 8px 22px rgba(88,200,157,.16); }
.period-card-btn span { color:var(--muted); font-size:12px; font-weight:700; }
.print-buttons { display:flex; gap:6px; flex-wrap:wrap; }
.printable-preview table { min-width: 520px; }
.printable-preview td { height: 44px; }
@media (max-width: 640px) { .period-card-list { grid-template-columns: 1fr; } .logo-block.center .app-logo { width: 130px; } }
@media print {
  .sidebar, .topbar, .actions, .modal-head .modal-close, .btn { display:none !important; }
  .modal-backdrop { position: static; background: #fff; padding:0; }
  .modal-card { box-shadow:none; border:0; max-height:none; width:100%; }
}

/* ============================================================
   2026-05-20 Safe UI polish patch
   Append-only: keeps original ZIP layout and fixes only targeted visuals.
   ============================================================ */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%) !important;
  color: #142b50 !important;
  border-right: 1px solid var(--line) !important;
  box-shadow: 8px 0 28px rgba(16, 32, 51, 0.04) !important;
}
.sidebar .side-brand,
.sidebar .side-brand *,
.side-brand {
  color: #142b50 !important;
}
.sidebar .nav-item,
.sidebar a.nav-item,
.sidebar button.nav-item {
  color: #142b50 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  font-weight: 750;
}
.sidebar .nav-item:hover,
.sidebar a.nav-item:hover,
.sidebar button.nav-item:hover {
  background: #eefbf5 !important;
  color: #142b50 !important;
  border-color: #c9f1dd !important;
}
.sidebar .nav-item.active,
.sidebar a.nav-item.active,
.sidebar button.nav-item.active {
  background: linear-gradient(135deg, #58c89d 0%, #6fd3ae 100%) !important;
  color: #142b50 !important;
  border-color: #58c89d !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 22px rgba(88, 200, 157, 0.22) !important;
}
.sidebar .side-footer,
.side-footer {
  border-top: 1px solid var(--line) !important;
}
.sidebar .side-footer,
.sidebar .side-footer *,
.side-footer,
.side-footer * {
  color: #142b50 !important;
}
.sidebar .side-footer span,
.side-footer span {
  color: #667085 !important;
}
.logo-block.center .app-logo {
  width: 250px;
  max-width: 70%;
}
.side-brand {
  justify-content: flex-start;
  margin-bottom: 28px;
}
.side-logo {
  width: 140px;
  max-width: 100%;
  height: auto;
  display: block;
}
body {
  background: linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
}
.main {
  padding: 28px 32px 50px;
}
.topbar {
  background: rgba(255,255,255,0.75);
  border: 1px solid #e6eaf0;
  border-radius: 22px;
  padding: 18px 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(16, 32, 51, 0.04);
}
.topbar h1 { color: #142b50; margin-bottom: 6px; }
.topbar p { color: #667085; }
.card {
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  box-shadow: 0 16px 40px rgba(16, 32, 51, 0.06);
}
input, select, textarea {
  border-color: #d8e1ea;
  border-radius: 14px;
}
.form-align-top,
.subscribe-contact-grid,
.profile-card-form .grid {
  align-items: start;
}
.form-align-top label small,
.subscribe-card label small,
.profile-card-form label small {
  min-height: 16px;
}
.phone-field-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: start;
}
.profile-card-form .grid.three {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
.profile-card-form .btn.primary {
  width: 100%;
}
.period-task-panel {
  display: grid;
  gap: 12px;
}
.period-task-notice {
  margin-bottom: 0;
}
.auth-card.centered,
.subscribe-card.centered {
  box-shadow: 0 22px 60px rgba(16, 32, 51, 0.08);
}
.modal-card {
  border-radius: 24px;
}
@media (max-width: 820px) {
  .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  }
  .main { padding: 18px 16px 30px; }
  .topbar { padding: 16px; border-radius: 18px; }
  .phone-field-grid,
  .profile-card-form .grid.three {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .logo-block.center .app-logo { width: 250px; max-width: 78%; }
}

/* ============================================================
   Period score-card preview patch
   Shows Week 1 by default and switches preview when another week card is clicked.
   ============================================================ */
.period-card-btn.active {
  border-color: #58c89d !important;
  background: #eafaf2 !important;
  box-shadow: 0 10px 24px rgba(88, 200, 157, 0.18) !important;
}
.period-task-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.period-task-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.period-task-preview-head h3 {
  margin-bottom: 4px;
  color: #142b50;
}
.period-task-preview-head p {
  margin-bottom: 0;
}
.period-task-list {
  display: grid;
  gap: 10px;
}
.period-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
.period-task-row span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}
@media (max-width: 640px) {
  .period-task-preview-head,
  .period-task-row {
    display: grid;
  }
}

/* International phone input patch - subscribe page */
.subscribe-contact-grid {
  align-items: start;
}

.intl-phone-label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
  color: #344054;
}

.intl-phone-label .iti {
  width: 100%;
}

.intl-phone-label input[type="tel"] {
  width: 100%;
  height: 42px;
}

.iti--separate-dial-code .iti__selected-flag {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
}

.iti__country-list {
  max-width: min(420px, 92vw);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(16, 32, 51, 0.18);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .intl-phone-label .iti {
    width: 100%;
  }
}

/* Company logo upload and owner company table */
.logo-upload-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: #344054;
}
.logo-upload-field input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
}
.logo-preview {
  width: 160px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.logo-preview img {
  max-width: 140px;
  max-height: 58px;
  object-fit: contain;
  display: block;
}
.company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.company-thumb {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  flex: 0 0 auto;
}

.check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-group-title {
  font-weight: 700;
  color: #142b50;
  font-size: 14px;
}
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7e8df;
  background: #ffffff;
  color: #142b50;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.check-option input {
  width: auto;
  margin: 0;
  accent-color: #58c89d;
}
.check-option.active {
  background: #f4faf7;
  border-color: #58c89d;
  box-shadow: 0 0 0 3px rgba(88, 200, 157, 0.12);
}
.selected-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.selected-periods span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d7e8df;
  background: #f4faf7;
  color: #142b50;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.payroll-period-sections {
  display: grid;
  gap: 18px;
}
.period-preview-card {
  border: 1px solid #e6edf5;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}
.period-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.period-preview-head h3 {
  margin: 0 0 4px;
  color: #001f3f;
  font-size: 18px;
}
.period-preview-head p {
  margin: 0;
}
.payroll-week-sections {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.week-preview-card {
  border: 1px solid #d7e8df;
  border-radius: 14px;
  padding: 12px;
  background: #f8fcfa;
}
.week-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.week-preview-head h4 {
  margin: 0 0 3px;
  color: #142b50;
  font-size: 15px;
}
.week-preview-head p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}
.total-pill.small {
  font-size: 13px;
  padding: 7px 10px;
}
.week-total-row,
.period-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e6edf5;
  font-weight: 800;
}
.week-total-row span,
.period-total-row span {
  color: #667085;
}
.period-total-row strong {
  font-size: 17px;
  color: #001f3f;
}
.period-grand-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #e6edf5;
  padding-top: 14px;
  font-weight: 900;
}
.period-grand-total span {
  color: #667085;
}
.period-grand-total strong {
  color: #001f3f;
  font-size: 20px;
}
@media (max-width: 720px) {
  .period-preview-head,
  .period-grand-total {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Search boxes in card headers */
.card-head-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.card-head-actions .search-input { width: min(320px, 56vw); padding: 8px 11px; border-radius: 10px; }
@media (max-width: 720px) {
  .card-head { align-items: stretch; flex-direction: column; }
  .card-head-actions { justify-content: flex-start; }
  .card-head-actions .search-input { width: 100%; }
}


/* Centered score-card duplicate popup */
.duplicate-scorecard-modal {
  display: grid;
  gap: 14px;
  text-align: center;
  padding: 8px 4px 2px;
}
.duplicate-scorecard-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  margin: 0 auto 2px;
  background: #fff1f1;
  border: 1px solid #ffd5d5;
  color: #9b1c1c;
  font-size: 30px;
  font-weight: 900;
}
.duplicate-scorecard-message {
  margin: 0;
  color: #142b50;
  font-size: 18px;
  font-weight: 900;
}
.duplicate-scorecard-help {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}
.duplicate-scorecard-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* Score Card History action buttons */
.actions.tight { gap: 6px; flex-wrap: nowrap; }

/* Centered delete score-card confirmation popup */
.delete-scorecard-modal {
  display: grid;
  gap: 14px;
  text-align: center;
  padding: 8px 4px 2px;
}
.delete-scorecard-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  margin: 0 auto 2px;
  background: #fff1f1;
  border: 1px solid #ffd5d5;
  color: #9b1c1c;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}
.delete-scorecard-message {
  margin: 0;
  color: #142b50;
  font-size: 18px;
  font-weight: 900;
}
.delete-scorecard-help {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}
.delete-scorecard-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.table-result-count {
  margin: 2px 0 10px;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
}

.load-more-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 4px 2px;
  color: var(--muted, #64748b);
  font-size: 13px;
  flex-wrap: wrap;
}

.load-more-row.centered {
  justify-content: center;
}
