/* Shared typography and spacing. Loaded after page-specific styles. */
:root{--ui-font:"Segoe UI",Tahoma,Arial,sans-serif;--ui-text:#263548;--ui-muted:#617187;--ui-border:#dce3ec;--ui-blue:#2563eb;--ui-space:16px}
html{font-size:16px!important;scroll-behavior:smooth}
html body,html body :is(h1,h2,h3,h4,h5,h6,p,div,span,a,label,input,textarea,select,button,th,td,li,legend,small,strong,summary):not(.fa):not(.fas):not(.far):not(.fab){font-family:var(--ui-font)!important}
html body{font-size:14px!important;line-height:1.5!important;letter-spacing:normal!important}
html body h1{font-size:26px!important}html body h2{font-size:23px!important}html body h3{font-size:20px!important}html body h4{font-size:18px!important}html body h5{font-size:16px!important}html body h6{font-size:14px!important}
html body :is(h1,h2,h3,h4,h5,h6){font-weight:600!important;line-height:1.3!important;margin:0 0 16px!important;letter-spacing:normal!important}
html body :is(p,label,a,li,th,td,input,select,textarea,button,.btn){font-size:14px!important;line-height:1.5!important}
html body p{margin:0 0 12px}html body small,html body .app-help{font-size:12px!important;line-height:1.5!important}
html body .main-content{padding:68px 24px 24px!important;min-width:0;box-sizing:border-box}
html body :is(.user_main_div,.user_main,.small_view_div){max-width:100%!important;box-sizing:border-box}
html body .user_main_div{width:100%!important;padding:18px!important;margin:0 auto 18px!important;border:1px solid var(--ui-border);box-shadow:0 2px 8px #172b4d08!important;border-radius:10px!important}
html body :is(.user_search,.search-row){gap:12px!important;min-width:0;flex-wrap:wrap}
html body .user_search{margin-bottom:16px!important}
html body :is(.user_search,.search-row) input{min-width:180px;flex:1 1 240px;max-width:100%;box-sizing:border-box}
html body .main-content :is(input[type=text],input[type=email],input[type=password],input[type=number],input[type=tel],input[type=date],input[type=search],select),html body .payment_form_div :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select){min-height:40px!important;padding:8px 12px!important;border:1px solid var(--ui-border)!important;border-radius:6px!important;box-shadow:none!important;box-sizing:border-box}
html body :is(input,select,textarea):focus-visible{outline:2px solid #2563eb70!important;outline-offset:2px;border-color:var(--ui-blue)!important}
html body textarea{padding:10px 12px!important;min-height:88px;border:1px solid var(--ui-border)!important;border-radius:6px!important;box-shadow:none!important;box-sizing:border-box;resize:vertical}
html body label{font-weight:500!important;margin-bottom:6px!important}
html body :is(input[type=checkbox],input[type=radio]){accent-color:var(--ui-blue)}
html body :is(.payment_row,.payment_full_col){gap:16px!important;margin-bottom:16px!important}
html body .payment_col{min-width:0;box-sizing:border-box}
html body .payment_row>.client-address-field{grid-column:1 / -1;flex:1 1 100%!important;width:100%!important;text-align:left}
html body .payment_row>.client-name-field{grid-column:1 / -1}
html body .client-name-field textarea{width:100%;min-height:76px;white-space:pre-wrap;overflow-wrap:anywhere}
html body .client-name-field .mobile_type{position:static;align-self:flex-end;margin-top:8px;width:70px!important}
html body .payment_form_div{padding:20px!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto;box-sizing:border-box;border-radius:10px!important}
html body .payment_form_div .top_head{margin-bottom:18px!important;padding-bottom:12px!important;border-bottom:1px solid var(--ui-border)}
html body .payment_form_div .top_head h5{margin-bottom:0!important}
html body :is(.btn,button[type=submit]){min-height:38px;padding:8px 14px;border-radius:6px;font-weight:500;letter-spacing:normal!important}
html body :is(.user_head,.user_data_row){line-height:1.5!important}
html body .main-content .user_data_row{padding:12px 14px!important;gap:10px!important}
html body .main-content .user_data_row>span{font-size:14px!important;line-height:1.5!important}
html body .main-content .user_data_row:is(.app-client-row,.app-reminder-row,.app-renewal-row,.app-cancel-row,.app-note-row)>span{font-size:14px!important;line-height:1.5!important}
html body :is(.user_data_load,.load_project_data){scroll-margin-top:80px}
html body .app-pagination.is-loading{opacity:.65;pointer-events:none}
html body .main-content :is(table th,table td){padding:10px 12px!important;font-size:14px!important;line-height:1.5!important;vertical-align:middle}
html body .main-content table th{font-weight:600!important}
html body .app-report nav:not(.app-pagination){gap:8px;margin:12px 0 18px}
html body .app-report .app-filters{gap:12px;margin:16px 0;align-items:end}
html body .app-summary{gap:14px;margin:16px 0 20px}
html body .app-pagination{display:flex!important;align-items:center!important;justify-content:space-between!important;flex-wrap:wrap!important;gap:12px!important;margin:20px 0 0!important;padding-top:14px!important;border-top:1px solid var(--ui-border)}
html body .app-pagination .app-page-summary{margin:0!important;color:var(--ui-muted);font-size:13px!important}
html body .app-pagination .pagination{display:flex;align-items:center;flex-wrap:wrap;gap:5px;list-style:none;padding:0!important;margin:0!important}
html body .app-pagination .page-item{margin:0!important;list-style:none}
html body .app-pagination .page-link{display:flex!important;align-items:center!important;justify-content:center!important;min-width:36px;min-height:36px;padding:7px 11px!important;margin:0!important;border:1px solid var(--ui-border)!important;border-radius:6px!important;background:#fff!important;color:#334155!important;font-size:13px!important;font-weight:500!important;line-height:1.2!important;box-shadow:none!important;text-decoration:none!important}
html body .app-pagination a.page-link:hover{background:#eff6ff!important;border-color:#93b4f9!important;color:#1d4ed8!important}
html body .app-pagination .active .page-link{background:var(--ui-blue)!important;border-color:var(--ui-blue)!important;color:#fff!important}
html body .app-pagination .disabled .page-link{color:#94a3b8!important;background:#f8fafc!important;cursor:default;pointer-events:none}
html body .app-pagination .page-link:focus-visible{outline:2px solid var(--ui-blue);outline-offset:2px}
html body .login-header h1{color:#fff}html body .login-body .form-group{margin-bottom:20px}
/* Viewport-centred payment details; long content scrolls below the close bar. */
html body .view_main_div{position:fixed!important;inset:auto!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;width:min(860px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;max-height:calc(100vh - 32px)!important;max-height:calc(100dvh - 32px)!important;margin:0!important;padding:0!important;display:flex;flex-direction:column;overflow:hidden!important;box-sizing:border-box;z-index:1000000!important;transition:none!important;box-shadow:0 16px 56px #0f172a40;border-radius:10px}
html body .view_main_div .payment-dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;padding:10px 16px;border-bottom:1px solid var(--ui-border);background:#fff}
html body .view_main_div .payment-dialog-bar h2{font-size:18px!important;margin:0!important}
html body .view_main_div #view_cancel_btn{position:static!important;display:flex;align-items:center;justify-content:center;flex:0 0 36px;width:36px;height:36px;min-height:36px;padding:0!important;border:1px solid var(--ui-border);border-radius:6px;background:#f8fafc;color:#334155;font-size:25px!important;line-height:1!important;cursor:pointer}
html body .view_main_div #view_cancel_btn:hover{background:#fee2e2;color:#b91c1c}
html body .view_main_div .view_scroll{position:relative;width:100%!important;min-width:0;min-height:0;height:auto!important;flex:1 1 auto;overflow:auto!important;overscroll-behavior:contain;padding:14px;box-sizing:border-box}
html body .view_main_div .payment-table-scroll{max-width:100%;overflow-x:auto;margin-top:14px}
html body .view_main_div #view_table{min-width:580px}
html body .view_main_div .view_head_div{padding:12px!important}
html body .view_main_div .view_row{gap:12px;padding:0!important}
html body .view_main_div .view_col{min-width:0;align-items:flex-start}
html body .view_main_div .view_col span{overflow-wrap:anywhere;padding:6px!important}
html body .image_preview{position:fixed!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;width:min(600px,calc(100vw - 24px))!important;height:min(560px,calc(100dvh - 32px))!important;max-height:calc(100vh - 32px);padding:16px!important;box-sizing:border-box;z-index:10000000!important;overflow:auto}
html body .image_preview img{max-width:100%!important;max-height:calc(100% - 70px)!important;width:auto!important;height:auto!important;object-fit:contain}
@media(max-width:600px){html body .view_main_div .view_row{grid-template-columns:1fr!important;gap:0}html body .view_main_div .view_scroll{padding:10px}html body .view_main_div .payment-dialog-bar{padding:8px 12px}}
@media(max-width:768px){html body .main-content{padding:68px 12px 16px!important}html body .user_main_div{padding:14px!important}html body h2{font-size:21px!important}html body .payment_form_div{padding:16px!important}html body .app-pagination{align-items:flex-start!important}html body .app-pagination .pagination{gap:4px}html body .app-pagination .page-link{min-width:34px;min-height:38px;padding:7px 9px!important}}
@media(max-width:480px){html body :is(.payment_row,.app-filters){flex-wrap:wrap!important}html body .payment_row>.payment_col{width:100%!important;flex:1 1 100%!important}html body .user_search input{min-width:0;flex-basis:100%}html body .app-pagination{gap:10px!important}html body .app-pagination .app-page-count{display:block}html body .app-pagination .pagination{width:100%}html body .app-pagination .page-link{min-width:30px;padding:7px 8px!important}html body .main-content :is(table th,table td){padding:9px!important}}

/* Renewal date range controls. */
html body .renewal-date-filters{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin-bottom:16px}
html body .renewal-date-filters>div{flex:1 1 180px;min-width:0}
html body .renewal-date-filters label{display:block}
html body .renewal-date-filters input{width:100%}
html body .renewal-date-filters button{min-height:40px;padding:8px 12px;border:1px solid var(--ui-border);border-radius:6px;background:#f8fafc;cursor:pointer}
html body .renewal-date-filters small,html body .renewal-date-filters p{flex-basis:100%;margin:0}
html body .renewal-date-filters p{color:#b91c1c}

html body a.app-whatsapp-link{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:36px;border:1px solid #b8e8cc;border-radius:6px;background:#edf9f1;color:#128c45!important;text-decoration:none;vertical-align:middle}
html body a.app-whatsapp-link .fa-whatsapp{font-size:22px!important;line-height:1}
html body a.app-whatsapp-link:hover{background:#d9f3e3}
html body a.app-whatsapp-link:focus-visible{outline:2px solid #128c45;outline-offset:2px}

/* Compact renewal filters, scoped to the renewals list. */
html body .app-renewals-page .user_main_div{padding:12px!important}
html body .app-renewals-page .renewals-toolbar{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;padding:0 0 12px;margin:0 0 8px;border-bottom:1px solid var(--ui-border)}
html body .app-renewals-page .renewals-toolbar .user_search{display:contents;margin:0!important}
html body .app-renewals-page .renewals-toolbar #search{flex:1 1 230px;min-width:180px;width:auto;margin:0}
html body .app-renewals-page .renewals-toolbar #renew_filter{flex:0 1 140px;width:140px;margin:0}
html body .app-renewals-page .renewals-status{display:flex;flex-direction:column;gap:3px;flex:0 1 130px;font-size:12px;margin:0!important}
html body .app-renewals-page .renewals-status select{width:100%;margin:0}
html body .app-renewals-page .renewal-date-filters{display:contents;margin:0}
html body .app-renewals-page .renewal-date-filters>div{flex:0 1 145px;min-width:135px}
html body .app-renewals-page .renewal-date-filters label{font-size:12px;line-height:1.3;margin:0 0 3px!important}
html body .app-renewals-page .renewal-date-filters input.app-date-entry{width:100%;margin:0;min-width:0}
html body .app-renewals-page #renew_dates_clear{flex:0 0 auto;min-height:40px;margin:0;padding:8px 12px}
html body .app-renewals-page #renew_date_error{flex-basis:100%;margin:0}
html body .app-renewals-page .user_head{margin-top:0!important}
@media(max-width:700px){html body .app-renewals-page .renewals-toolbar #search{flex-basis:100%;width:100%}html body .app-renewals-page .renewals-toolbar #renew_filter,html body .app-renewals-page .renewals-status,html body .app-renewals-page .renewal-date-filters>div{flex:1 1 140px;width:auto}}

/* Keep the first page controls close to the fixed 60px header. */
html body .main-content>.user_main_div>.user_search,html body .main-content>.user_main_div>.filter_div .user_search{margin-top:0!important}
html body .main-content>.user_main_div>.renewals-toolbar{margin-top:0!important}
html body .main-content>.user_main_div>.small_view_div>.user_head{margin-top:8px!important}

/* Matching columns for project headings and client rows. */
html body .main-content.app-projects-page .small_view_div{overflow-x:auto;padding:0!important}
html body .main-content.app-projects-page .user_head,html body .main-content.app-projects-page .user_data_row.app-client-row{display:grid!important;grid-template-columns:32px minmax(0,1.1fr) 150px minmax(0,1.35fr) 105px 130px 210px;align-items:center!important;gap:12px!important;width:100%!important;min-width:0!important;box-sizing:border-box;padding:12px 14px!important;margin:0!important}
html body .main-content.app-projects-page .user_head{position:static!important;background:#edf2f8;border-radius:7px;color:#52637a}
html body .main-content.app-projects-page .user_head>p{margin:0!important;width:auto!important;text-align:left!important}
html body .main-content.app-projects-page .user_data_main_row{min-width:0!important;width:100%!important;margin:0!important;border-bottom:1px solid #e4eaf1;padding:0!important}
html body .main-content.app-projects-page .user_data_row.app-client-row>span{min-width:0!important;width:auto!important;max-width:100%;margin:0!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important;line-height:1.5!important}
html body .main-content.app-projects-page .user_data_row.app-client-row>span:nth-child(3){display:flex;align-items:center;gap:8px;white-space:nowrap!important;overflow-wrap:normal}
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_total,html body .main-content.app-projects-page .user_data_row.app-client-row>.user_renew{font-variant-numeric:tabular-nums;white-space:nowrap!important}
html body .main-content.app-projects-page .app-client-actions{display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap!important;gap:6px;min-width:0;width:210px!important;white-space:nowrap}
html body .main-content.app-projects-page .app-client-actions>span{display:inline-flex;width:auto!important;margin:0!important;cursor:pointer}
html body .main-content.app-projects-page .app-client-actions>span>i{display:inline-flex;align-items:center;justify-content:center;width:28px;height:32px;padding:0!important;margin:0!important;font-size:14px!important}
html body .main-content.app-projects-page .app-client-actions .app-ledger-link{padding:5px 7px!important;border:1px solid #dce3ec;border-radius:5px;line-height:20px}

html body .main-content.app-projects-page .app-client-actions>*{flex:0 0 auto!important;min-width:0!important;max-width:none!important}
html body .main-content.app-projects-page .app-client-actions>span{position:static!important;float:none!important}

/* Financial amounts must never be clipped by legacy span styles. */
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_total,html body .main-content.app-projects-page .user_data_row.app-client-row>.user_renew{display:block!important;overflow:visible!important;text-overflow:clip!important;max-width:none!important;width:auto!important;padding:0!important;letter-spacing:normal!important}

/* Fit project names into two lines without widening the client list. */
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_project{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden!important;white-space:normal!important;overflow-wrap:anywhere!important;max-width:100%!important;padding:0!important;line-height:1.5!important;max-height:3em;cursor:pointer}
html body .main-content.app-projects-page .app-client-actions .app-ledger-link{display:inline-flex;align-items:center;justify-content:center;width:28px;height:32px;padding:0!important}
@media(max-width:1150px){
html body .main-content.app-projects-page .user_head{display:none!important}
html body .main-content.app-projects-page .user_data_row.app-client-row{grid-template-columns:28px minmax(0,1fr) minmax(0,1fr);gap:10px!important}
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_project{grid-column:2 / -1}
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_total{grid-column:2}
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_total::before{content:'Total ';color:#617187;font-weight:400}
html body .main-content.app-projects-page .app-client-actions{grid-column:2 / -1}
html body .main-content.app-projects-page .user_data_row.app-client-row>span:nth-child(3){flex-wrap:wrap;min-width:0!important}
}
/* Align wrapped project names with their column heading. */
html body .main-content.app-projects-page .user_data_row.app-client-row>.user_project{text-align:left!important;justify-self:stretch!important;align-self:center!important;direction:ltr;margin-left:0!important;margin-right:0!important;padding-left:0!important;text-indent:0!important}
