:root {
  --brand: #1a56c8;
  --brand-dark: #0c2a5a;
  --brand-light: #2bb0ea;
  --bg: #f3f7fb;
  --sidebar: #ffffff;
  --text: #0c2a5a;
  --muted: #6b7c93;
  --line: #e8eef5;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(12, 42, 90, .06);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.cpt-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
}
a { color: inherit; }
.cpt-shell { display: flex; min-height: 100vh; }

.cpt-nav {
  width: 248px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  color: var(--text);
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  overflow: auto;
}
.cpt-brand {
  display: block;
  padding: 4px 6px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.cpt-brand-logo,
.cpt-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border-radius: 0;
}
.cpt-portal-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 8px 6px;
}
.cpt-company {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 14px;
  padding: 8px 10px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-dark);
}
.cpt-company i { color: var(--brand); }
.cpt-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4b5563;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}
.cpt-link i { width: 18px; text-align: center; font-size: 16px; }
.cpt-link:hover { background: #e8f6fc; color: var(--brand); }
.cpt-link.is-on { background: var(--brand); color: #fff; }
.cpt-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.cpt-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 10px;
}
.cpt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2bb0ea, #1a56c8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.cpt-user-name { font-size: 13px; font-weight: 800; line-height: 1.2; }
.cpt-user-mail { font-size: 11px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.cpt-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cpt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 28px 0;
}
.cpt-top-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cpt-top-company { font-size: 15px; font-weight: 800; color: var(--brand-dark); }
.cpt-top-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.cpt-main { padding: 18px 28px 36px; max-width: 1040px; }
.cpt-title { font-size: 26px; font-weight: 800; margin: 0 0 4px; color: var(--brand-dark); }
.cpt-lead { color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.cpt-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.cpt-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #4b5563;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.cpt-tab i { font-size: 16px; color: var(--brand); }
.cpt-tab em {
  font-style: normal;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #eff6ff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}
.cpt-tab:hover { border-color: #c7d2fe; color: var(--brand); background: #f8fbff; }
.cpt-tab.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cpt-tab.is-on i, .cpt-tab.is-on em { color: #fff; }
.cpt-tab.is-on em { background: rgba(255,255,255,.22); }
@media (max-width: 575px) {
  .cpt-tab { flex-direction: column; gap: 2px; min-height: 56px; font-size: 11px; padding: 8px 4px; }
}

.cpt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.cpt-kpis.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cpt-inv-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cpt-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--kpi-accent, var(--brand));
}
a.cpt-kpi:hover { border-color: #c7d2fe; color: inherit; box-shadow: 0 12px 28px rgba(12, 42, 90, .1); }
.cpt-kpi-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--kpi-tint, #eff6ff);
  color: var(--kpi-accent, var(--brand));
  flex-shrink: 0;
}
.cpt-kpi-n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.cpt-kpi-l { font-size: 12px; font-weight: 700; color: var(--muted); }

.cpt-card, .cpt-row, .cpt-empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.cpt-card h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; }
.cpt-card > a {
  display: inline-flex;
  margin-top: 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
}
.cpt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cpt-row-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--brand);
  font-size: 18px;
  flex-shrink: 0;
}
.cpt-row-body { min-width: 0; flex: 1; }
.cpt-row-body strong { display: block; font-weight: 800; }
.cpt-row-body .muted { font-size: 12px; font-weight: 600; color: var(--muted); }
.muted { font-size: 12px; font-weight: 600; color: var(--muted); }
.cpt-ico-unpaid { background: #fef2f2; color: #dc2626; }
.cpt-ico-partial { background: #fff7ed; color: #ea580c; }
.cpt-ico-paid { background: #f0fdf4; color: #16a34a; }
.cpt-amt { text-align: right; flex-shrink: 0; min-width: 88px; }
.cpt-amt .muted { font-size: 11px; font-weight: 700; }
.cpt-amt-n { font-weight: 800; line-height: 1.15; }
.cpt-inv-figs {
  display: grid;
  grid-template-columns: 6.75rem 6.75rem 6.75rem;
  gap: 10px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cpt-inv-figs > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cpt-inv-fig-l {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.cpt-inv-fig-n {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.cpt-inv-fig-n.is-pending { color: #c2410c; }
.cpt-inv-figs-dates {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 420px;
  margin-top: 10px;
  text-align: left;
}
.cpt-row-alert { border-color: #fecaca; }
.cpt-row-warn { border-color: #fed7aa; }
.cpt-amt-n.is-pending { color: #c2410c; font-size: 12px; }
.cpt-inv-bar {
  height: 6px; border-radius: 99px; background: #e8eef5; overflow: hidden; margin-top: 8px; max-width: 220px;
}
.cpt-inv-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2bb0ea, #1a56c8); }
.cpt-inv-unpaid span { background: linear-gradient(90deg, #f87171, #dc2626); }
.cpt-inv-partial span { background: linear-gradient(90deg, #fb923c, #ea580c); }
.cpt-inv-paid span { background: linear-gradient(90deg, #4ade80, #16a34a); }
.cpt-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.cpt-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
}
.cpt-pill.is-paid, .cpt-pill.is-fulfilled, .cpt-pill.is-signed, .cpt-pill.is-done, .cpt-pill.is-active { background: #f0fdf4; color: #15803d; }
.cpt-pill.is-unpaid, .cpt-pill.is-expired, .cpt-pill.is-cancelled, .cpt-pill.is-void, .cpt-pill.is-retired { background: #fef2f2; color: #b91c1c; }
.cpt-pill.is-open { background: #eff6ff; color: #1d4ed8; }
.cpt-pill.is-pending { background: #fef2f2; color: #b91c1c; }
.cpt-pill.is-partial, .cpt-pill.is-in_progress { background: #fff7ed; color: #c2410c; }
.cpt-empty {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 48px 24px;
}
.cpt-empty i { display: block; font-size: 32px; color: var(--brand); margin-bottom: 10px; }
.cpt-empty h2 { font-size: 18px; font-weight: 800; color: var(--brand-dark); margin: 0 0 6px; }
.cpt-empty .btn { margin-top: 12px; }

.cpt-compose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.cpt-compose-head {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 70%);
  border-bottom: 1px solid #dbeafe;
  color: var(--text);
}
.cpt-compose-head h2 { font-size: 18px; font-weight: 800; margin: 0 0 4px; color: var(--brand-dark); }
.cpt-compose-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 2px;
}
.cpt-compose-head p { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.cpt-compose-ico {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1a56c8, #2bb0ea); color: #fff;
  font-size: 18px; flex-shrink: 0;
}
.cpt-compose-body { padding: 16px 18px 18px; }
.cpt-compose-body .form-label { font-weight: 700; font-size: 12px; color: var(--muted); }
.cpt-compose-body .form-control, .cpt-compose-body .form-select { border-radius: 12px; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
  border-radius: 999px;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.alert { border-radius: 12px; font-weight: 600; }

body.cpt-auth-body { margin: 0; }
.cpt-auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(125, 211, 240, .55), transparent 55%),
    radial-gradient(700px 420px at 100% 110%, rgba(26, 86, 200, .45), transparent 50%),
    linear-gradient(160deg, #0c2a5a 0%, #1a56c8 52%, #2bb0ea 100%);
}
.cpt-auth-shell {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(12, 42, 90, .28);
  min-height: 540px;
}
.cpt-auth-hero {
  background:
    radial-gradient(420px 280px at 80% 0%, rgba(125, 211, 240, .35), transparent 60%),
    linear-gradient(165deg, #2bb0ea 0%, #1a56c8 58%, #0c2a5a 100%);
  color: #fff;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
}
.cpt-auth-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 10px;
}
.cpt-auth-hero h2 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 10px;
}
.cpt-auth-hero > p { margin: 0 0 20px; color: rgba(255,255,255,.88); font-size: 14px; line-height: 1.45; }
.cpt-auth-points { display: grid; gap: 10px; margin-top: auto; }
.cpt-auth-point {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 10px 12px;
}
.cpt-auth-point i {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 18px; flex-shrink: 0;
}
.cpt-auth-point strong { display: block; font-size: 13px; font-weight: 800; }
.cpt-auth-point span { display: block; font-size: 12px; color: rgba(255,255,255,.82); }
.cpt-auth-card {
  padding: 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cpt-logo { height: 48px; margin-bottom: 14px; }
.cpt-auth-badge {
  display: inline-flex;
  align-self: flex-start;
  background: #eff6ff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.cpt-auth-title { font-size: 26px; font-weight: 800; margin: 0 0 4px; color: var(--brand-dark); }
.cpt-sub { color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.cpt-auth-form .form-label { font-weight: 700; font-size: 13px; color: var(--brand-dark); }
.cpt-field { position: relative; margin-bottom: 14px; }
.cpt-field i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 16px;
}
.cpt-field .form-control { padding-left: 40px; height: 44px; border-radius: 12px; }
.cpt-submit { width: 100%; height: 44px; margin-top: 6px; }
.cpt-demo { margin-top: 16px; font-size: 12px; font-weight: 600; color: var(--muted); }

.cpt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid #2563eb;
}
.cpt-item:hover { border-color: #c7d2fe; }
.cpt-item-main {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; flex: 1; text-decoration: none; color: inherit;
}
.cpt-item-ico {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
  background: #eff6ff; color: #2563eb;
}
.cpt-item-name { font-weight: 800; }
.cpt-item-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.cpt-item-sub a { color: var(--brand); text-decoration: none; }
.cpt-item-sub a:hover { text-decoration: underline; }
.cpt-item-need {
  margin-top: 4px; font-size: 12px; font-weight: 600; color: #475569;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cpt-item-amt { text-align: right; flex-shrink: 0; min-width: 72px; }
.cpt-item-amt strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.1; }
.cpt-item-amt span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.cpt-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.cpt-item-actions .btn { font-weight: 800; white-space: nowrap; border-radius: 999px; }
.cpt-item .cpt-inv-bar { margin-top: 8px; }
.cpt-tone-open { border-left-color: #2563eb; }
.cpt-tone-open .cpt-item-ico { background: #eff6ff; color: #2563eb; }
.cpt-tone-progress { border-left-color: #ea580c; }
.cpt-tone-progress .cpt-item-ico { background: #fff7ed; color: #ea580c; }
.cpt-tone-done { border-left-color: #0f766e; }
.cpt-tone-done .cpt-item-ico { background: #ccfbf1; color: #0f766e; }
.cpt-tone-alert { border-left-color: #dc2626; }
.cpt-tone-alert .cpt-item-ico { background: #fef2f2; color: #dc2626; }
.cpt-tone-signed { border-left-color: #7c3aed; }
.cpt-tone-signed .cpt-item-ico { background: #f5f3ff; color: #7c3aed; }

.cpt-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 100%;
}
.cpt-panel-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 68%);
  border-bottom: 1px solid #dbeafe;
}
.cpt-panel-head.is-green { background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 68%); border-bottom-color: #99f6e4; }
.cpt-panel-head.is-orange { background: linear-gradient(135deg, #fff7ed 0%, #f8fafc 68%); border-bottom-color: #fed7aa; }
.cpt-panel-ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, #1a56c8, #2bb0ea);
}
.cpt-panel-head.is-green .cpt-panel-ico { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.cpt-panel-head.is-orange .cpt-panel-ico { background: linear-gradient(135deg, #ea580c, #f97316); }
.cpt-panel-head h2 { font-size: 16px; font-weight: 800; margin: 0; color: var(--brand-dark); }
.cpt-panel-head p { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.cpt-panel-head a, .cpt-panel-more {
  margin-left: auto; font-size: 13px; font-weight: 800; color: var(--brand); text-decoration: none; white-space: nowrap;
}
.cpt-panel-body { padding: 12px 14px 14px; }
.cpt-panel-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }

.cpt-jumps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.cpt-jump {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit;
  border-left: 4px solid var(--kpi-accent, var(--brand));
}
.cpt-jump:hover { border-color: #c7d2fe; color: inherit; box-shadow: 0 12px 28px rgba(12, 42, 90, .1); }
.cpt-jump-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--kpi-tint, #eff6ff); color: var(--kpi-accent, var(--brand)); font-size: 18px; flex-shrink: 0;
}
.cpt-jump strong { display: block; font-size: 14px; font-weight: 800; }
.cpt-jump span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }

.cpt-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.cpt-compose-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px;
}
.cpt-compose-foot .btn { border-radius: 999px; font-weight: 800; height: 42px; padding: 0 16px; }
.btn-outline-primary { border-radius: 999px; font-weight: 800; }

@media (max-width: 991px) {
  .cpt-kpis, .cpt-jumps { grid-template-columns: 1fr 1fr; }
  .cpt-kpis.is-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .cpt-shell { flex-direction: column; }
  .cpt-nav { width: 100%; height: auto; position: static; }
  .cpt-nav nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .cpt-link { flex: 1 1 140px; }
  .cpt-main, .cpt-top { padding-left: 16px; padding-right: 16px; }
  .cpt-kpis, .cpt-kpis.is-3, .cpt-jumps { grid-template-columns: 1fr; }
  .cpt-inv-kpis { grid-template-columns: 1fr 1fr; }
  .cpt-row, .cpt-item { flex-wrap: wrap; }
  .cpt-inv-figs { width: 100%; grid-template-columns: 1fr 1fr 1fr; }
  .cpt-auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .cpt-auth-hero { min-height: 220px; }
  .cpt-auth-card { padding: 28px 22px; }
  .cpt-brand-logo, .cpt-logo { height: 40px; }
}
