/* =====================================================================
   HESCOM app-wide theme (loaded by every master page and standalone page).
   - Responsive basics + styled pop-ups: every page.
   - Control styles (labels, text boxes, dropdowns, grids, buttons): only when
     Scripts/app-theme.js puts "app-ui" on <html> (interactive screens; print,
     report and receipt pages are left exactly as they are).
   - Pages that already have their own modern design (login, payment, consumer
     search, bill print, dashboard, public New Connection site) are excluded by
     their body class.
   :where() keeps the scope selectors at zero specificity so the portal's own
   sidebar / top-bar styles still win.
   ===================================================================== */

/* ---------- responsive basics (all pages) ---------- */
img, embed, object, video { max-width: 100%; }
img { height: auto; }
.app-scroll-x { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
    body { -webkit-text-size-adjust: 100%; }
    /* fixed-width layout tables/divs from the old pages may not push the page sideways */
    :where(html.app-ui) :where(table, div)[style*="width: 9"][style*="px"],
    :where(html.app-ui) :where(table, div)[style*="width:9"][style*="px"],
    :where(html.app-ui) :where(table, div)[style*="width: 1"][style*="px"],
    :where(html.app-ui) :where(table, div)[style*="width:1"][style*="px"] { max-width: 100% !important; }
    :where(html.app-ui) table[width="950"], :where(html.app-ui) table[width="1000"], :where(html.app-ui) table[width="1020"],
    :where(html.app-ui) table[width="1100"], :where(html.app-ui) table[width="1185"], :where(html.app-ui) table[width="1200"] { width: 100% !important; }
    /* form tables (tagged app-stack by the script): label above field, one column */
    html.app-ui table.app-stack, html.app-ui table.app-stack > tbody, html.app-ui table.app-stack > tbody > tr,
    html.app-ui table.app-stack > tbody > tr > td, html.app-ui table.app-stack > tr, html.app-ui table.app-stack > tr > td {
        display: block !important; width: auto !important; max-width: 100% !important; height: auto !important; float: none !important;
    }
    html.app-ui table.app-stack > tbody > tr > td, html.app-ui table.app-stack > tr > td { padding: 3px 0 !important; text-align: left !important; }
    html.app-ui table.app-stack > tbody > tr { margin-bottom: 6px; }
    html.app-ui table.app-stack input[type=text], html.app-ui table.app-stack input[type=password], html.app-ui table.app-stack input[type=email],
    html.app-ui table.app-stack input[type=number], html.app-ui table.app-stack input[type=date], html.app-ui table.app-stack input[type=file],
    html.app-ui table.app-stack select, html.app-ui table.app-stack textarea { width: 100% !important; max-width: 100% !important; }
    html.app-ui table.app-stack input[type=submit], html.app-ui table.app-stack input[type=button] { width: 100%; margin: 5px 0 !important; }
    /* keep a lone red "*" next to its label */
    html.app-ui table.app-stack > tbody > tr > td.app-req,
    html.app-ui table.app-stack > tbody > tr > td:has(+ td.app-req) { display: inline-block !important; width: auto !important; }
}

/* =====================================================================
   Control theme  (S = scope, X = keep site chrome out)
   ===================================================================== */
/* ---------- base font ---------- */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) {
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
}

/* ---------- labels ---------- */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(.labelStyle, .LabelStyle, .labelStyles, .NormalLabel, .lblStyle, label):not(:where(.ps-sidebar *, .ps-topbar *, .pub-nav *, .app-alert *, .hm *, .app-skip *)) {
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important;
    font-size: 13.5px !important; color: #334155; font-weight: 600;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(.header3, .SubHead, .SubHeadMain, .SubSubHead) {
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; color: #17406a;
}
:where(html.app-ui) .app-req { color: #e0435f !important; font-weight: 700 !important; }

/* ---------- text boxes, dropdowns, text areas ---------- */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(input[type=text], input[type=password], input[type=email], input[type=number], input[type=tel], input[type=date], input:not([type]), select, textarea):not(:where(.ps-sidebar *, .ps-topbar *, .pub-nav *, .app-alert *, .hm *, .app-skip *, .ps-search-input)) {
    min-height: 36px; padding: 6px 10px !important;
    border: 1.5px solid #d5dee8 !important; border-radius: 9px !important;
    background-color: #f8fafc !important; color: #1f2d3d !important;
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; font-size: 13.5px !important; line-height: 1.3;
    box-shadow: none !important; box-sizing: border-box; max-width: 100%;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) select:not(:where(.ps-sidebar *, .ps-topbar *)) { padding-right: 26px !important; cursor: pointer; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) textarea:not(:where(.ps-sidebar *)) { min-height: 64px; resize: vertical; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(input, select, textarea):focus:not(:where(.ps-sidebar *, .ps-topbar *, .pub-nav *, [type=submit], [type=button], [type=radio], [type=checkbox])) {
    outline: none !important; background-color: #fff !important; border-color: #1c6fb8 !important;
    box-shadow: 0 0 0 3px rgba(28, 111, 184, .15) !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(input[readonly], input[disabled], select[disabled], textarea[readonly], textarea[disabled]):not([type=submit], [type=button], [type=radio], [type=checkbox], [type=image]) {
    background-color: #eef3f8 !important; color: #52627a !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) input[type=file] {
    padding: 5px 8px !important; border: 1.5px dashed #c5d3e2 !important; border-radius: 9px !important; background: #f8fbff !important; font-size: 13px !important; max-width: 100%;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) input[type=file]::file-selector-button {
    margin-right: 8px; padding: 5px 10px; border: 0; border-radius: 7px; background: #e8f1fa; color: #1c6fb8; font-weight: 600; cursor: pointer;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(input[type=radio], input[type=checkbox]) {
    accent-color: #1c6fb8; width: 16px; height: 16px; vertical-align: middle; cursor: pointer;
}

/* ---------- buttons ---------- */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(input[type=submit], input[type=button], input[type=reset], button, .buttonStyle, .submitButton, .SaveBtnStyle, .backContStyle):not(:where(.ps-sidebar *, .ps-topbar *, .pub-nav *, .app-alert *, .hm *, .app-skip *, .ui-dialog-titlebar *, .ps-icon-btn, .ps-nav-parent, .ps-search-clear, .ui-datepicker *)) {
    min-height: 36px; height: auto !important; padding: 7px 18px !important; margin: 3px;
    border: 0 !important; border-radius: 10px !important; cursor: pointer;
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; font-size: 13.5px !important; font-weight: 700 !important;
    color: #fff !important; text-shadow: none !important; letter-spacing: .2px;
    background: linear-gradient(135deg, #2b8be0, #1c6fb8) !important;
    box-shadow: 0 6px 14px rgba(28, 111, 184, .25) !important;
    transition: transform .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body))
    :is(input[type=submit], input[type=button], button):hover:not(:where(.ps-sidebar *, .ps-topbar *, .pub-nav *, .app-alert *, .hm *, .app-skip *, [disabled])) {
    transform: translateY(-1px); box-shadow: 0 9px 18px rgba(28, 111, 184, .33) !important;
}
/* save / submit / approve: orange */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(.SaveBtnStyle, .app-btn-main):not(:where(.ps-sidebar *, .ps-topbar *)) {
    background: linear-gradient(135deg, #ffb547, #f28c28) !important; box-shadow: 0 6px 14px rgba(242, 140, 40, .3) !important;
}
/* clear / cancel / back / exit / reset / close: outline */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(.ClearBtnStyle, .ExitBtnStyle, .app-btn-sec):not(:where(.ps-sidebar *, .ps-topbar *)) {
    background: #fff !important; color: #1f2d3d !important; border: 1.5px solid #d5dee8 !important; box-shadow: none !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(.ClearBtnStyle, .ExitBtnStyle, .app-btn-sec):hover { background: #f3f6f9 !important; transform: none; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(input[type=submit], input[type=button], button)[disabled] {
    background: #c3ceda !important; box-shadow: none !important; cursor: not-allowed; transform: none;
}

/* ---------- grids (tables whose first row is all <th>; tagged app-grid by the script) ---------- */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid {
    border-collapse: separate !important; border-spacing: 0 !important; border: 1px solid #e3e9f0 !important;
    border-radius: 10px; background: #fff !important; font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important;
    font-size: 13px !important; color: #1f2d3d; box-shadow: 0 3px 12px rgba(16, 35, 56, .06);
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > th,
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > thead > tr > th {
    background: #17406a !important; color: #fff !important; font-weight: 600 !important; font-size: 12.5px !important;
    padding: 9px 10px !important; border: 0 !important; border-right: 1px solid rgba(255, 255, 255, .08) !important;
    text-align: left; white-space: nowrap; vertical-align: middle;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > th :is(a, span, label) { color: #fff !important; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > td {
    padding: 8px 10px !important; border: 0 !important; border-top: 1px solid #edf1f5 !important; vertical-align: middle;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr:nth-child(even) > td { background-color: #f8fafc; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr:hover > td { background-color: #eef5fc; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid a { color: #1c6fb8; font-weight: 600; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid caption {
    caption-side: top; text-align: left; padding: 8px 2px; font-weight: 700; font-size: 14.5px; color: #17406a;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid :is(input[type=submit], input[type=button]) {
    min-height: 30px; padding: 4px 12px !important; font-size: 12px !important; border-radius: 7px !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid tr.app-pager > td { background: #f1f5fa !important; text-align: center; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid tr.app-pager table { margin: 0 auto; border: 0 !important; box-shadow: none; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid tr.app-pager td { border: 0 !important; padding: 2px 4px !important; }
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid tr.app-pager span {
    display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 6px; background: #1c6fb8; color: #fff !important; font-weight: 700;
}
/* grid box: wide grids scroll sideways; long grids keep a fixed header row */
.app-grid-box { max-width: 100%; overflow: auto; border-radius: 10px; -webkit-overflow-scrolling: touch; }
.app-grid-box.is-tall { max-height: 480px; }
.app-grid-box > table.app-grid > tbody > tr:first-child > th,
.app-grid-box > table.app-grid > thead > tr > th { position: sticky; top: 0; z-index: 2; }

/* =====================================================================
   Pop-ups (all pages)
   ===================================================================== */
/* message pop-up that replaces the browser's alert() */
.app-alert-bg {
    position: fixed; inset: 0; z-index: 30000; display: flex; align-items: center; justify-content: center; padding: 18px;
    background: rgba(10, 22, 36, .55); animation: appFade .15s ease-out;
}
.app-alert {
    width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 26px 24px 20px; text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .3); font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif; animation: appPop .18s ease-out;
}
.app-alert-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.app-alert.is-info .app-alert-ico { background: #e8f1fa; color: #1c6fb8; }
.app-alert.is-ok .app-alert-ico { background: #e7f6ee; color: #1e9e57; }
.app-alert.is-warn .app-alert-ico { background: #fff3e6; color: #e07c1c; }
.app-alert.is-err .app-alert-ico { background: #fdecef; color: #d93c55; }
.app-alert h3 { margin: 0 0 6px; font-size: 18px; color: #1f2d3d; font-weight: 700; }
.app-alert p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: #44566a; white-space: pre-line; overflow-wrap: anywhere; }
.app-alert button {
    min-width: 140px; height: 46px; border: 0 !important; border-radius: 12px !important; cursor: pointer; color: #fff !important; padding: 0 20px !important;
    font: 700 15px "Segoe UI", Roboto, Arial, sans-serif !important; background: linear-gradient(135deg, #ffb547, #f28c28) !important;
    box-shadow: 0 8px 18px rgba(242, 140, 40, .32) !important;
}
.app-alert button:focus-visible { outline: 3px solid rgba(242, 140, 40, .45); outline-offset: 2px; }
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes appPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* jQuery UI dialogs (ShowPopup on many screens) */
.ui-widget-overlay { background: rgba(10, 22, 36, .55) !important; opacity: 1 !important; filter: none !important; }
.ui-dialog.ui-widget {
    padding: 0 !important; border: 0 !important; border-radius: 16px !important; overflow: hidden; max-width: calc(100vw - 24px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .3) !important; font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important;
}
.ui-dialog .ui-dialog-titlebar {
    border: 0 !important; border-radius: 0 !important; padding: 12px 16px !important; background: linear-gradient(135deg, #1d4f86, #17406a) !important;
    color: #fff !important; font-size: 15px; font-weight: 700;
}
.ui-dialog .ui-dialog-titlebar-close { background: rgba(255, 255, 255, .15) !important; border: 0 !important; border-radius: 8px !important; }
.ui-dialog .ui-dialog-content { padding: 18px 18px 8px !important; font-size: 14.5px !important; color: #334155 !important; line-height: 1.55; }
.ui-dialog .ui-dialog-buttonpane { border: 0 !important; margin: 0 !important; padding: 8px 16px 16px !important; background: #fff !important; }
.ui-dialog .ui-dialog-buttonpane button {
    min-width: 96px; height: 40px; padding: 0 18px !important; border: 0 !important; border-radius: 10px !important; cursor: pointer;
    color: #fff !important; font-weight: 700 !important; background: linear-gradient(135deg, #ffb547, #f28c28) !important;
    box-shadow: 0 6px 14px rgba(242, 140, 40, .3) !important;
}
/* AjaxControlToolkit ModalPopupExtender */
.modalBackground { background: rgba(10, 22, 36, .55) !important; opacity: 1 !important; filter: none !important; }
:is(.modalPopup, .ModalPopup, .modal-dialog, .popupStyle, .PopupStyle, .popup) {
    border-radius: 16px !important; box-shadow: 0 30px 70px rgba(0, 0, 0, .3) !important;
    max-width: calc(100vw - 24px); max-height: calc(100vh - 30px); overflow: auto;
}
/* AjaxControlToolkit calendar */
.ajax__calendar_container {
    border: 1px solid #e3e9f0 !important; border-radius: 12px !important; padding: 8px !important; background: #fff !important; z-index: 1000 !important;
    box-shadow: 0 14px 34px rgba(16, 35, 56, .18) !important; font-family: "Segoe UI", Roboto, Arial, sans-serif !important;
}
.ajax__calendar_title { font-weight: 700; color: #17406a; }
.ajax__calendar_dayname { font-weight: 600; color: #66788a; }
.ajax__calendar_hover :is(.ajax__calendar_day, .ajax__calendar_month, .ajax__calendar_year) { background: #e8f1fa !important; color: #1c6fb8 !important; border-color: transparent !important; border-radius: 6px; }
.ajax__calendar_active :is(.ajax__calendar_day, .ajax__calendar_month, .ajax__calendar_year) { background: #f28c28 !important; color: #fff !important; border-color: transparent !important; border-radius: 6px; }
/* jQuery UI datepicker */
.ui-datepicker { border: 1px solid #e3e9f0 !important; border-radius: 12px !important; padding: 6px !important; box-shadow: 0 14px 34px rgba(16, 35, 56, .18) !important; }
.ui-datepicker .ui-datepicker-header { border: 0 !important; border-radius: 9px !important; background: #17406a !important; color: #fff !important; }
.ui-datepicker .ui-state-active { background: #f28c28 !important; border-color: #f28c28 !important; color: #fff !important; }

@media print {
    .app-alert-bg { display: none !important; }
    .app-grid-box { max-height: none !important; overflow: visible !important; }
}


/* =====================================================================
   Button types (class app-btn-<type> is set by Scripts/app-theme.js from the button text).
   The repeated class only raises specificity so these win over the general button styles
   of the portal and the public site.
   ===================================================================== */
:is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    border: 0 !important; color: #fff !important; text-shadow: none !important;
    transition: transform .15s, box-shadow .15s, filter .15s;
}
:is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k:hover:not([disabled]) { transform: translateY(-1px); filter: brightness(1.04); }

/* Save / Update - green */
:is(input, button).app-btn-save.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #34c48b, #1e9e57) !important; box-shadow: 0 6px 14px rgba(30, 158, 87, .30) !important;
}
/* Submit / Approve / Confirm / Proceed / Pay - orange */
:is(input, button).app-btn-submit.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #ffb547, #f28c28) !important; box-shadow: 0 6px 14px rgba(242, 140, 40, .32) !important;
}
/* Search / Show / View / Fetch / Get - blue */
:is(input, button).app-btn-search.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #2b8be0, #1c6fb8) !important; box-shadow: 0 6px 14px rgba(28, 111, 184, .28) !important;
}
/* Clear / Reset / Refresh - brown */
:is(input, button).app-btn-clear.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #c8946a, #8d5a32) !important; color: #fff !important; border: 0 !important; box-shadow: 0 6px 14px rgba(141, 90, 50, .30) !important;
}/* Cancel / Reject / Delete / Remove - red */
:is(input, button).app-btn-danger.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #f06b7e, #d93c55) !important; box-shadow: 0 6px 14px rgba(217, 60, 85, .28) !important;
}
/* Exit / Close / Logout - dark slate */
:is(input, button).app-btn-exit.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #475569, #1f2d3d) !important; box-shadow: 0 6px 14px rgba(31, 45, 61, .28) !important;
}
/* Back / Home / Previous - magenta */
:is(input, button).app-btn-back.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #e070e6, #b02fb8) !important; color: #fff !important; border: 0 !important; box-shadow: 0 6px 14px rgba(176, 47, 184, .28) !important;
}/* Edit / Modify / Change - amber */
:is(input, button).app-btn-edit.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #f6c445, #d99a06) !important; color: #3d2c00 !important; box-shadow: 0 6px 14px rgba(217, 154, 6, .28) !important;
}
/* Print / Download / Export / Excel / PDF / Report - purple */
:is(input, button).app-btn-print.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #a07cf0, #7444d6) !important; box-shadow: 0 6px 14px rgba(116, 68, 214, .28) !important;
}
/* Add / New / Create / Insert / Upload / Generate - teal */
:is(input, button).app-btn-add.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #2cc6c6, #0f9fa8) !important; box-shadow: 0 6px 14px rgba(15, 159, 168, .28) !important;
}
/* Send OTP / Verify / Validate - indigo */
:is(input, button).app-btn-verify.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background: linear-gradient(135deg, #6c7ff2, #3a4cc8) !important; box-shadow: 0 6px 14px rgba(58, 76, 200, .28) !important;
}
:is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k[disabled] {
    background: #c3ceda !important; color: #fff !important; border: 0 !important; box-shadow: none !important; cursor: not-allowed; transform: none; filter: none;
}


/* =====================================================================
   Button pictures: a small line icon on the left of each button type
   (inline SVG, so it works on every page without an icon font).
   ===================================================================== */
:is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    padding-left: 38px !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: 13px center, 0 0 !important;
    background-size: 16px 16px, 100% 100% !important;
}
table :is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k { padding-left: 30px !important; background-position: 10px center, 0 0 !important; background-size: 13px 13px, 100% 100% !important; }
:is(input, button).app-btn-save.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h11l3 3v15H5z'/%3E%3Cpath d='M8 3v5h7V3'/%3E%3Cpath d='M8 21v-7h8v7'/%3E%3C/svg%3E"), linear-gradient(135deg, #34c48b, #1e9e57) !important; }
:is(input, button).app-btn-submit.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"), linear-gradient(135deg, #ffb547, #f28c28) !important; }
:is(input, button).app-btn-search.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E"), linear-gradient(135deg, #2b8be0, #1c6fb8) !important; }
:is(input, button).app-btn-clear.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E"), linear-gradient(135deg, #c8946a, #8d5a32) !important; }
:is(input, button).app-btn-danger.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E"), linear-gradient(135deg, #f06b7e, #d93c55) !important; }
:is(input, button).app-btn-exit.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5v16h5'/%3E%3Cpath d='M14 8l4 4-4 4'/%3E%3Cpath d='M18 12H9'/%3E%3C/svg%3E"), linear-gradient(135deg, #475569, #1f2d3d) !important; }
:is(input, button).app-btn-back.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='M11 6l-6 6 6 6'/%3E%3C/svg%3E"), linear-gradient(135deg, #e070e6, #b02fb8) !important; }
:is(input, button).app-btn-edit.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d2c00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20l4-1 11-11-3-3L5 16z'/%3E%3Cpath d='M14 6l3 3'/%3E%3C/svg%3E"), linear-gradient(135deg, #f6c445, #d99a06) !important; }
:is(input, button).app-btn-print.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9V3h10v6'/%3E%3Cpath d='M7 18H4v-8h16v8h-3'/%3E%3Cpath d='M7 14h10v7H7z'/%3E%3C/svg%3E"), linear-gradient(135deg, #a07cf0, #7444d6) !important; }
:is(input, button).app-btn-add.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"), linear-gradient(135deg, #2cc6c6, #0f9fa8) !important; }
:is(input, button).app-btn-verify.app-btn-k.app-btn-k.app-btn-k.app-btn-k { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 5-3 8-7 10-4-2-7-5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"), linear-gradient(135deg, #6c7ff2, #3a4cc8) !important; }
:is(input, button).app-btn-k.app-btn-k.app-btn-k.app-btn-k.app-btn-k[disabled] { background-image: none !important; background-color: #c3ceda !important; padding-left: 18px !important; }

/* Home buttons: same magenta as Back, with a house picture */
:is(input, button).app-btn-home.app-btn-k.app-btn-k.app-btn-k.app-btn-k {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7'/%3E%3Cpath d='M6 10v10h12V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E"), linear-gradient(135deg, #e070e6, #b02fb8) !important; color: #fff !important; border: 0 !important; box-shadow: 0 6px 14px rgba(176, 47, 184, .28) !important;
}
/* grid already inside a scrolling area of the page: no second scrollbar, header row still pinned */
.app-grid-box.is-plain { overflow: visible !important; max-height: none !important; }

/* =====================================================================
   Whole screen visible: no inner vertical scroll boxes (only the page scrolls)
   ===================================================================== */
.app-unclip { height: auto !important; max-height: none !important; overflow-y: visible !important; overflow-x: auto !important; }
.app-grid-box, .app-grid-box.is-tall, .app-grid-box.is-plain { max-height: none !important; overflow-y: visible !important; overflow-x: auto !important; }
.pub-body .pub-card .pub-grid-box.is-tall { max-height: none !important; }
.ch-scroll-tall, .ch-result { max-height: none !important; }

/* =====================================================================
   Uniform look: labels inside grids, headers, panels
   ===================================================================== */
/* labels / values inside grids: normal weight, grid font, no fixed widths or colours from the old pages */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > td :is(span, label, .labelStyle, .LabelStyle, .labelStyles, font) {
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; font-size: 13px !important;
    font-weight: 400 !important; color: #1f2d3d !important; width: auto !important; height: auto !important; background: transparent !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > td a:not(.app-btn-k) {
    color: #1c6fb8 !important; font-weight: 600 !important; font-size: 13px !important;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) table.app-grid > tbody > tr > td :is(input[type=text], select) { min-height: 32px; font-size: 13px !important; }
/* same inside the public site's grids */
.pub-body .pub-card table.gt-grid > tbody > tr > td :is(span, label, font) {
    font-size: 13px !important; font-weight: 400 !important; color: #1f2d3d !important; width: auto !important; background: transparent !important;
}

/* section header bars (old blue/green cells) and heading classes */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(td[style*="006699"], td[style*="0066CC"], td[style*="0066cc"], td[style*="003366"], td[bgcolor="#006699"], td[bgcolor="#0066CC"],
        .headerStyle, .HeaderStyle, .header3, .pageheadingStyle, .PageHeading, .pageHeading, .GridHeaderStyle, .DataGrid_Header) {
    background: linear-gradient(135deg, #1d4f86, #17406a) !important; color: #fff !important;
    padding: 9px 14px !important; border: 0 !important; border-radius: 9px;
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; font-size: 14px !important; font-weight: 700 !important;
    letter-spacing: .3px; text-align: left;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(td[style*="006699"], td[style*="0066CC"], td[style*="0066cc"], td[style*="003366"], .headerStyle, .HeaderStyle, .header3, .pageheadingStyle, .PageHeading, .pageHeading) :is(span, label, font, b) {
    color: #fff !important; background: transparent !important; font-size: 14px !important; font-weight: 700 !important; width: auto !important;
}
/* panel titles (asp:Panel GroupingText renders fieldset + legend) */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) fieldset:not(:where(.ps-sidebar *, .ps-topbar *)) {
    border: 1px solid #e3e9f0 !important; border-radius: 12px; padding: 12px 14px 14px !important; margin: 10px 0; background: #fff;
}
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) fieldset > legend {
    padding: 3px 12px !important; border-radius: 20px; background: #17406a; color: #fff !important;
    font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif !important; font-size: 13px !important; font-weight: 700 !important;
}
/* radio button / check box lists */
:where(html.app-ui body:not(.op-body, .pub-body, .bp-body, .auth-body, .db-body)) :is(input[type=radio], input[type=checkbox]) + label {
    font-size: 13.5px !important; font-weight: 600; color: #334155; margin: 0 14px 0 5px; cursor: pointer; vertical-align: middle;
}

/* =====================================================================
   Grids with more than 10 rows: 10 rows visible, scroll inside the grid, header fixed
   (max-height is set by app-theme.js from the real row heights)
   ===================================================================== */
.app-grid-box.app-grid-cap, .pub-grid-box.app-grid-cap { overflow-y: auto !important; overflow-x: auto !important; overscroll-behavior: contain; }
.app-grid-cap > table > tbody > tr:first-child > th, .app-grid-cap > table > thead > tr > th { position: sticky !important; top: 0; z-index: 3; }
