.tpm-app-page footer,
.tpm-app-page .site-footer,
.tpm-app-page #colophon {
    display: none !important;
}
.tpm-app-page .entry-title,
.tpm-app-page .wp-block-post-title { display: none !important; }
.tpm-app-page { overflow-x: hidden; }
.tpm-app-page body > .wp-site-blocks > main.wp-block-group > .wp-block-group.has-global-padding:first-child,
.tpm-app-page main.wp-block-group > .wp-block-group.has-global-padding:first-child { display: none !important; }
.tpm-app-page .wp-block-site-title a { display: inline-flex; align-items: center; gap: 12px; }
.tpm-site-logo { display: block; width: 48px; height: 40px; object-fit: contain; }
.tpm-app-page .tpm-menu-logout a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 12px;
    color: #fff !important;
    background: #2563eb;
    font-weight: 700;
    text-decoration: none;
    transition: .18s ease;
}
.tpm-app-page .tpm-menu-logout a:hover { background: #1d4ed8; transform: translateY(-1px); }

.tpm-shell {
    --tpm-bg: #f4f7fb;
    --tpm-card: #fff;
    --tpm-text: #172033;
    --tpm-muted: #687386;
    --tpm-line: #e2e8f0;
    --tpm-blue: #2563eb;
    --tpm-blue-dark: #1d4ed8;
    box-sizing: border-box;
    display: grid;
    min-height: min(760px, 88vh);
    place-items: center;
    padding: 32px 18px;
    color: var(--tpm-text);
    background: var(--tpm-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tpm-shell * { box-sizing: border-box; }
.tpm-card {
    position: relative;
    width: min(100%, 440px);
    padding: 42px;
    border: 1px solid var(--tpm-line);
    border-radius: 24px;
    background: var(--tpm-card);
    box-shadow: 0 18px 55px rgba(36, 50, 75, .08);
}
.tpm-card-wide { width: min(100%, 920px); }
.tpm-cad-mapping {
    min-width: 0;
    margin: 24px 0;
    padding: 18px 24px 24px;
    border: 1px solid var(--tpm-line);
    border-radius: 16px;
    background: #f8fafc;
}
.tpm-cad-mapping legend {
    padding: 0 10px;
    color: var(--tpm-text);
    font-size: 18px;
    font-weight: 700;
}
.tpm-cad-mapping .tpm-cad-field {
    display: grid;
    grid-template-columns: minmax(0, 280px) 120px;
    align-items: center;
    gap: 12px 24px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.5;
}
.tpm-cad-field input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: var(--tpm-text);
    font: inherit;
}
.tpm-cad-mapping .tpm-cad-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.5;
}
.tpm-cad-check input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--tpm-blue);
}
.tpm-cad-mapping input:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .tpm-cad-mapping { padding: 12px; }
    .tpm-cad-mapping .tpm-cad-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .tpm-cad-field input { max-width: 160px; }
}
.tpm-main-shell {
    position: relative !important;
    left: calc(50% - 50vw + 24px) !important;
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    transform: none !important;
}
.tpm-main-shell .tpm-card-wide { width: min(100%, 1200px); }
.tpm-welcome { text-align: center; }
.tpm-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 22px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: var(--tpm-blue);
    font-size: 28px;
    font-weight: 700;
}
.tpm-shell h1 { margin: 0 0 28px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
.tpm-shell h2 { margin: 0 0 18px; font-size: 20px; }
.tpm-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 1px solid var(--tpm-line);
    border-radius: 13px;
    color: var(--tpm-text);
    background: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: .18s ease;
}
.tpm-button:hover { border-color: #b9c6d8; transform: translateY(-1px); }
.tpm-button-primary { border-color: var(--tpm-blue); color: #fff; background: var(--tpm-blue); }
.tpm-button-primary:hover { border-color: var(--tpm-blue-dark); background: var(--tpm-blue-dark); }
.tpm-button-danger { min-height: 40px; padding: 8px 14px; border-color: #dc2626; color: #fff; background: #dc2626; }
.tpm-button-danger:hover { border-color: #b91c1c; background: #b91c1c; }
.tpm-button-disabled { color: #9aa5b5; background: #f7f9fc; cursor: not-allowed; }
.tpm-button-disabled:hover { transform: none; }
.tpm-back { position: absolute; top: 22px; left: 24px; color: var(--tpm-muted); text-decoration: none; font-size: 22px; }
.tpm-form { display: grid; gap: 18px; }
.tpm-form label { display: grid; gap: 8px; color: var(--tpm-muted); font-size: 14px; font-weight: 600; }
.tpm-form input {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid var(--tpm-line);
    border-radius: 12px;
    color: var(--tpm-text);
    background: #fff;
    font: inherit;
    outline: none;
}
.tpm-form input:focus { border-color: var(--tpm-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tpm-error { padding: 12px 14px; border-radius: 11px; color: #991b1b; background: #fef2f2; font-size: 14px; }
.tpm-success { padding: 12px 14px; border-radius: 11px; color: #166534; background: #f0fdf4; font-size: 14px; }
.tpm-app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.tpm-app-header h1 { margin: 4px 0 0; font-size: clamp(25px, 4vw, 36px); }
.tpm-eyebrow { color: var(--tpm-blue); font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tpm-logout { color: var(--tpm-muted); text-decoration: none; font-weight: 600; }
.tpm-upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.tpm-file {
    display: grid;
    min-height: 96px;
    align-content: center;
    gap: 9px;
    padding: 15px;
    border: 1px dashed #bac6d6;
    border-radius: 14px;
    color: var(--tpm-text);
    background: #fbfcfe;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}
.tpm-file:hover { border-color: var(--tpm-blue); background: #f6f9ff; }
.tpm-file { position: relative; overflow: hidden; }
.tpm-file > input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tpm-file-picker { display: flex; min-width: 0; align-items: center; gap: 10px; }
.tpm-file-button {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid #16a34a;
    border-radius: 9px;
    color: #fff;
    background: #16a34a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}
.tpm-file:hover .tpm-file-button { border-color: #15803d; background: #15803d; }
.tpm-file-name { min-width: 0; overflow: hidden; color: var(--tpm-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tpm-process { grid-column: 1 / -1; margin-top: 3px; }
.tpm-calculation-block { padding: 26px; border: 1px solid var(--tpm-line); border-radius: 18px; background: #fff; }
.tpm-calculation-block + .tpm-calculation-block { margin-top: 24px; }
.tpm-calculation-block-mzp { border-color: #bfdbfe; background: #f8fbff; }
.tpm-calculation-heading { margin-bottom: 18px; }
.tpm-calculation-heading h2 { margin-bottom: 5px; }
.tpm-calculation-heading p { margin: 0; color: var(--tpm-muted); font-size: 14px; }
.tpm-report-link { margin-top: 14px; text-align: center; }
.tpm-report-link a { color: var(--tpm-blue); font-weight: 700; text-underline-offset: 3px; }
.tpm-nav-links { display: flex; justify-content: center; gap: 24px; }
.tpm-summary { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--tpm-line); }
.tpm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tpm-stats div { padding: 16px; border-radius: 13px; background: #f6f8fb; }
.tpm-stats strong { display: block; margin-bottom: 3px; font-size: 24px; }
.tpm-stats span { color: var(--tpm-muted); font-size: 13px; }
.tpm-total { margin: 18px 0 0; color: var(--tpm-muted); }
.tpm-total strong { color: var(--tpm-text); }
.tpm-transfer-total { margin-top: 18px; }
.tpm-transfer-total .tpm-total { margin-top: 0; }
.tpm-transfer-breakdown { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 10px; }
.tpm-transfer-breakdown span { color: var(--tpm-muted); font-size: 14px; }
.tpm-transfer-breakdown strong { margin-left: 5px; color: var(--tpm-text); }
.tpm-result-months { margin-top: 24px; }
.tpm-result-months h3 { margin: 0 0 12px; font-size: 16px; }
.tpm-result-months > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tpm-result-months article { display: grid; gap: 8px; padding: 14px 16px; border-radius: 13px; background: #f6f8fb; }
.tpm-result-months span,
.tpm-result-months small { display: flex; justify-content: space-between; gap: 16px; }
.tpm-result-months small { color: var(--tpm-muted); }
.tpm-result-months b { white-space: nowrap; }
.tpm-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.tpm-report-shell {
    position: relative !important;
    left: calc(50% - 50vw + 24px) !important;
    display: block;
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
    min-height: 100vh;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 28px;
    transform: none !important;
}
.tpm-report-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 32px;
}
.tpm-table-wrap { overflow-x: auto; border: 1px solid var(--tpm-line); border-radius: 14px; }
.tpm-report-actions { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.tpm-report-actions-top { margin: 0 0 18px; }
.tpm-report-actions-bottom { justify-content: center; margin-top: 22px; }
.tpm-page-size { display: grid; gap: 6px; color: var(--tpm-muted); font-size: 12px; font-weight: 700; }
.tpm-page-size select { min-width: 100px; min-height: 42px; padding: 8px 34px 8px 11px; border: 1px solid var(--tpm-line); border-radius: 10px; background: #fff; }
.tpm-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.tpm-pagination-info { color: var(--tpm-muted); font-size: 13px; }
.tpm-pagination-controls { display: flex; gap: 8px; }
.tpm-pagination-button { width: 42px; height: 42px; border: 1px solid var(--tpm-line); border-radius: 10px; color: var(--tpm-text); background: #fff; cursor: pointer; }
.tpm-pagination-button.is-active { border-color: var(--tpm-blue); color: #fff; background: var(--tpm-blue); opacity: 1; }
.tpm-pagination-button:disabled { cursor: default; opacity: .4; }
.tpm-pagination-separator { display: grid; width: 24px; place-items: center; color: var(--tpm-muted); }
.tpm-report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tpm-warning-label { display: inline-block; padding: 5px 8px; border-radius: 8px; color: #991b1b; background: #fee2e2; font-size: 12px; font-weight: 700; }
.tpm-warning-summary { margin: 18px 0 0; padding: 12px 14px; border-radius: 11px; color: #7f1d1d; background: #fef2f2; }
.tpm-warning-summary a { color: #991b1b; font-weight: 700; }
.tpm-report-filter { display: grid; gap: 7px; color: var(--tpm-muted); font-size: 13px; font-weight: 700; }
.tpm-report-filter select {
    width: 100%;
    min-height: 44px;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--tpm-line);
    border-radius: 11px;
    color: var(--tpm-text);
    background: #fff;
    font: inherit;
}
.tpm-report-table { width: 100%; min-width: 1400px; border-collapse: collapse; font-size: 13px; }
.tpm-report-table th,
.tpm-report-table td { padding: 11px 12px; border-bottom: 1px solid var(--tpm-line); text-align: left; vertical-align: top; }
.tpm-report-table th { position: sticky; top: 0; color: var(--tpm-muted); background: #fff; font-size: 12px; }
.tpm-report-table tbody tr:nth-child(odd) { background: #f7f9fc; }
.tpm-report-table tbody tr:last-child td { border-bottom: 0; }
.tpm-status-label { display: inline-block; padding: 3px 7px; border-radius: 5px; color: #334155; background: #e9eef5; white-space: nowrap; }
.tpm-sort-amount { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.tpm-sort-amount:hover { color: var(--tpm-blue); }
.tpm-report-table th:nth-child(2),
.tpm-report-table td:nth-child(2) { min-width: 260px; }
.tpm-empty { color: var(--tpm-muted); }
.tpm-debtors { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--tpm-line); }
.tpm-debtors-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.tpm-debtors-heading h2 { margin-bottom: 5px; }
.tpm-debtors-heading p { margin: 0; color: var(--tpm-muted); }
.tpm-debtors-dialog { width: min(92vw, 620px); padding: 0; border: 0; border-radius: 20px; color: var(--tpm-text); box-shadow: 0 24px 80px rgba(15, 23, 42, .3); }
.tpm-debtors-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.tpm-debtors-dialog form { display: grid; gap: 20px; padding: 28px; }
.tpm-debtors-dialog .tpm-file { min-height: 120px; }
.tpm-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.tpm-dialog-header h2 { margin: 0; }
.tpm-dialog-header button { padding: 0; border: 0; color: var(--tpm-muted); background: none; font-size: 30px; cursor: pointer; }
.tpm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.tpm-button:disabled { border-color: #dbe2eb; color: #9aa5b5; background: #edf1f6; cursor: not-allowed; transform: none; }
.tpm-debtor-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0 18px; }
.tpm-debtor-summary article { display: grid; gap: 7px; padding: 18px; border-radius: 14px; background: #f6f8fb; }
.tpm-debtor-summary span { color: var(--tpm-muted); font-size: 13px; }
.tpm-debtor-summary strong { font-size: 20px; }
.tpm-debtor-summary b { color: var(--tpm-blue); }
.tpm-csv-source { display: none; }
.tpm-debtor-table { min-width: 1050px; }
.tpm-debtor-table th:nth-child(2), .tpm-debtor-table td:nth-child(2) { min-width: 130px; }
.tpm-name-search { display: grid; gap: 7px; margin: 4px 0 16px; color: var(--tpm-muted); font-size: 13px; font-weight: 700; }
.tpm-name-search-control { position: relative; }
.tpm-name-search input {
    width: 100%; min-height: 46px; padding: 10px 48px 10px 13px; border: 1px solid var(--tpm-line);
    border-radius: 11px; color: var(--tpm-text); background: #fff; font: inherit; font-weight: 500; outline: none;
}
.tpm-name-search input:focus { border-color: var(--tpm-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.tpm-name-search-control > button {
    position: absolute; z-index: 2; top: 5px; right: 7px; width: 36px; height: 36px; padding: 0; border: 0;
    border-radius: 8px; color: var(--tpm-muted); background: transparent; font-size: 24px; cursor: pointer;
}
.tpm-name-search-control > button:hover { color: var(--tpm-text); background: #f1f5f9; }
.tpm-name-suggestions {
    position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; left: 0; overflow-y: auto; max-height: 340px;
    padding: 6px; border: 1px solid var(--tpm-line); border-radius: 12px; background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
}
.tpm-name-suggestions button {
    display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; color: var(--tpm-text);
    background: transparent; font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.tpm-name-suggestions button:hover, .tpm-name-suggestions button.is-active { color: #1d4ed8; background: #eff6ff; }
.tpm-archive-table { width: 100%; border-collapse: collapse; }
.tpm-archive-table th,
.tpm-archive-table td { padding: 14px 16px; border-bottom: 1px solid var(--tpm-line); text-align: left; }
.tpm-archive-table th { color: var(--tpm-muted); background: #f8fafc; font-size: 13px; }
.tpm-archive-table tbody tr:last-child td { border-bottom: 0; }
.tpm-archive-table a { color: var(--tpm-blue); font-weight: 700; text-underline-offset: 3px; }
.tpm-archive-breakdown { display: block; margin-top: 5px; color: var(--tpm-muted); line-height: 1.55; }
.tpm-archive-months { display: grid; gap: 6px; white-space: nowrap; }
.tpm-archive-months > span { display: grid; gap: 4px; }
.tpm-month-detail > span { display: grid; grid-template-columns: minmax(88px, auto) auto; gap: 12px; }
.tpm-month-detail small { color: var(--tpm-muted); }
.tpm-muted { color: var(--tpm-muted); }
.tpm-delete-form { margin: 0; }
.tpm-archive-table th:last-child,
.tpm-archive-table td:last-child { width: 120px; text-align: right; }

@media (max-width: 720px) {
    .tpm-card { padding: 30px 22px; border-radius: 18px; }
    .tpm-upload-grid, .tpm-stats, .tpm-downloads { grid-template-columns: 1fr; }
    .tpm-process { grid-column: auto; }
    .tpm-app-header { align-items: center; }
    .tpm-report-filters { grid-template-columns: 1fr; }
    .tpm-debtors-heading { align-items: stretch; flex-direction: column; }
    .tpm-debtor-summary { grid-template-columns: 1fr; }
    .tpm-calculation-block { padding: 20px 16px; }
    .tpm-result-months > div { grid-template-columns: 1fr; }
}

.tpm-sms-shell {
    position: relative !important;
    left: calc(50% - 50vw + 24px) !important;
    display: block;
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 28px;
    transform: none !important;
}
.tpm-sms-card { width: 100% !important; max-width: none !important; margin: 0 auto; padding: 32px; }
.tpm-sms-form { display: grid; gap: 10px; margin-top: 24px; }
.tpm-sms-form label { font-weight: 700; margin-top: 8px; }
.tpm-sms-form textarea { width: 100%; box-sizing: border-box; resize: vertical; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.tpm-sms-form small { color: #64748b; text-align: right; }
.tpm-sms-form .tpm-button { justify-self: start; margin-top: 12px; }
.tpm-sms-tabs { display: flex; gap: 8px; margin: 8px 0 16px; padding: 5px; border-radius: 12px; background: #eef2f7; }
.tpm-sms-tab { flex: 1; padding: 12px 18px; border: 0; border-radius: 9px; background: transparent; color: #475569; font: inherit; font-weight: 700; cursor: pointer; }
.tpm-sms-tab.is-active { background: #fff; color: var(--tpm-blue); box-shadow: 0 2px 10px rgba(36, 50, 75, .12); }
.tpm-sms-mode-panel { display: grid; gap: 10px; }
.tpm-sms-mode-panel[hidden], .tpm-sms-template-tools[hidden], .tpm-sms-preview[hidden] { display: none !important; }
.tpm-sms-mode-panel input[type="file"] { padding: 18px; border: 1px dashed #94a3b8; border-radius: 10px; background: #f8fafc; }
.tpm-sms-example, .tpm-sms-preview { margin: 4px 0; padding: 12px 14px; border-radius: 9px; background: #f8fafc; color: #475569; }
.tpm-sms-template-tools { display: flex; align-items: center; gap: 12px; }
.tpm-sms-template-tools .tpm-button { margin: 0; padding: 7px 12px; }
.tpm-sms-archive-table { min-width: 900px; }
.tpm-sms-archive-message { min-width: 280px; max-width: 520px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tpm-sms-report-card { width: 100% !important; max-width: none !important; margin: 0 auto; padding: 32px; }
.tpm-sms-stats { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 16px; margin-top: 28px; }
.tpm-sms-stats div { border-top: 6px solid #f58220; padding: 14px 4px; display: flex; flex-direction: column; }
.tpm-sms-stats div:nth-child(2) { border-color: #71ad36; }
.tpm-sms-stats div:nth-child(3) { border-color: #94a3b8; }
.tpm-sms-stats div:nth-child(4) { border-color: #dc2626; }
.tpm-sms-stats strong { font-size: 30px; }
.tpm-sms-stats span { color: #64748b; }
@media (max-width: 700px) { .tpm-sms-stats { grid-template-columns: 1fr 1fr; } }
