/* =====================================================================
   MCalc UI 2.0 - complete design system (loaded after Bootstrap 4.6)
   Modern billing-app look: clean white cards on a soft grey canvas,
   blue brand + orange accent, Inter font, big touch targets on phones.
   ===================================================================== */
:root {
    /* AutoDeal theme (same colours, font, shapes as the AutoDeal-Solution project) */
    --brand: #32BDEA; --brand-600: #1a9cc9; --brand-700: #13789b; --brand-50: #eaf8fd; --brand-100: #d3f1fb; --brand-200: #bfe0ec;
    --accent: #ff7e41; --accent-50: #fff1ea; --navy: #0E4A5A;
    --ink: #0f3d4f; --text: #24414d; --muted: #6b8490; --faint: #9ab0ba;
    --line: #e3edf1; --line-2: #eef4f6; --input: #d7e4ea; --soft: #f8fbfc; --bg: #f4f8fa; --card: #ffffff;
    --green: #1f9d6b; --green-50: #e6f6ef; --amber: #c98a0b; --amber-50: #fdf4e1; --red: #d64545; --red-50: #fdeaea;
    --violet: #6c5dd3; --violet-50: #efedfb; --teal: #0d9488; --teal-50: #f0fdfa;
    --r: 14px; --r-sm: 10px; --r-lg: 20px;
    --sh-1: none;
    --sh-2: 0 8px 20px rgba(15, 61, 79, .08);
    --sh-3: 0 14px 34px rgba(15, 61, 79, .16);
    --font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --top-h: 64px;
    /* old names used by earlier pages */
    --mc-blue: var(--brand); --mc-blue-d: var(--brand-600); --mc-blue-50: var(--brand-50); --mc-blue-100: var(--brand-100);
    --mc-orange: var(--accent); --mc-orange-50: var(--accent-50); --mc-ink: var(--ink); --mc-text: var(--text); --mc-muted: var(--muted);
    --mc-line: var(--line); --mc-input: var(--input); --mc-soft: var(--soft); --mc-bg: var(--bg); --mc-green: var(--green); --mc-green-50: var(--green-50);
    --mc-amber: var(--amber); --mc-amber-50: var(--amber-50); --mc-red: var(--red); --mc-red-50: var(--red-50); --mc-violet: var(--violet);
    --mc-violet-50: var(--violet-50); --mc-radius: var(--r); --mc-shadow: var(--sh-2); --mc-font: var(--font);
}

/* ------------------------------------------------------------ base */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font); color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h4, .h4 { font-size: 1.15rem; } h5, .h5 { font-size: 1.02rem; } h6, .h6 { font-size: .92rem; }
a { color: var(--brand); } a:hover { color: var(--brand-700); }
::selection { background: var(--brand-100); }
b, strong { font-weight: 600; }
hr { border-top-color: var(--line); }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--brand) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--amber) !important; }
.bg-primary { background-color: var(--brand) !important; }
.bg-success { background-color: var(--green) !important; }
.bg-danger { background-color: var(--red) !important; }
.bg-warning { background-color: var(--amber) !important; }
.font-weight-700 { font-weight: 700 !important; }
.mc-hide, [hidden] { display: none !important; }
#loading { display: none !important; }
.num, .mc-num { font-variant-numeric: tabular-nums; }
*:focus-visible { outline: 2px solid var(--brand-200); outline-offset: 1px; }

/* ------------------------------------------------------------ buttons */
.btn { font-weight: 600; font-size: 14px; border-radius: 10px; padding: 8px 16px; line-height: 1.45; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s; box-shadow: none !important; white-space: nowrap; }
.btn i { font-size: 1.12em; line-height: 1; }
.btn-sm { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; }
.btn-lg { font-size: 15.5px; padding: 11px 22px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):active { background: var(--brand-600) !important; border-color: var(--brand-600) !important; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff !important; }
.btn-success:hover, .btn-success:focus { background: #15803d; border-color: #15803d; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff !important; }
.btn-warning { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.btn-warning:hover { background: #ea580c; border-color: #ea580c; }
.btn-info { background: #0ea5e9; border-color: #0ea5e9; color: #fff !important; }
.btn-secondary, .btn-light, .btn-default { background: var(--card); border: 1px solid var(--line); color: var(--ink) !important; }
.btn-secondary:hover, .btn-light:hover, .btn-default:hover { background: var(--soft); border-color: var(--input); color: var(--ink) !important; }
.btn-outline-primary { border-color: var(--brand-200); color: var(--brand) !important; background: var(--card); }
.btn-outline-primary:hover { background: var(--brand-50); border-color: var(--brand); }
.btn-outline-danger { border-color: #fecaca; color: var(--red) !important; background: var(--card); }
.btn-outline-danger:hover { background: var(--red-50); border-color: var(--red); }
.btn-ghost { background: transparent; border: 0; color: var(--muted) !important; padding: 6px 8px; }
.btn-ghost:hover { background: var(--line-2); color: var(--ink) !important; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn-icon.btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.btn:disabled, .btn.disabled, .aspNetDisabled.btn { opacity: .55; pointer-events: none; }
.btn-link { color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------ badges / chips */
.badge { font-weight: 600; font-size: 11.5px; padding: 4px 8px; border-radius: 6px; letter-spacing: .01em; }
.badge-primary, .bg-primary-light { background: var(--brand-50) !important; color: var(--brand-600) !important; }
.badge-success, .bg-success-light { background: var(--green-50) !important; color: var(--green) !important; }
.badge-danger, .bg-danger-light { background: var(--red-50) !important; color: var(--red) !important; }
.badge-warning, .bg-warning-light { background: var(--amber-50) !important; color: var(--amber) !important; }
.badge-info, .bg-info-light { background: #f0f9ff !important; color: #0369a1 !important; }
.badge-secondary, .badge-light { background: var(--line-2) !important; color: var(--text) !important; }
.mc-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--brand-50); color: var(--brand-600); white-space: nowrap; line-height: 1.6; }
.mc-chip--SALES, .mc-chip--ok, .mc-chip--green { background: var(--green-50); color: var(--green); }
.mc-chip--PURCHASE, .mc-chip--orange { background: var(--accent-50); color: #c2410c; }
.mc-chip--QUOTATION, .mc-chip--violet { background: var(--violet-50); color: var(--violet); }
.mc-chip--bad, .mc-chip--red { background: var(--red-50); color: var(--red); }
.mc-chip--warn, .mc-chip--amber { background: var(--amber-50); color: var(--amber); }
.mc-chip--grey { background: var(--line-2); color: var(--muted); }
.mc-chip--teal { background: var(--teal-50); color: var(--teal); }

/* ------------------------------------------------------------ cards */
.card { border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); background: var(--card); margin-bottom: 16px; }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header:first-child { border-radius: var(--r) var(--r) 0 0; }
.card-header .card-title, .card-header h4, .card-header h5, .card-header .header-title h4 { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); }
.card-body { padding: 18px; }
.card-footer { background: var(--soft); border-top: 1px solid var(--line-2); padding: 12px 18px; }
.card-footer:last-child { border-radius: 0 0 var(--r) var(--r); }
.header-title h4, .header-title .card-title { margin: 0; }

/* ------------------------------------------------------------ forms */
label, .control-label, .col-form-label { font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.form-group { margin-bottom: 14px; }
.form-control { height: 40px; border: 1px solid var(--input); border-radius: 10px; background-color: var(--card); font-size: 14px; color: var(--ink); padding: 0 12px;
    box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); color: var(--ink); }
.form-control::placeholder { color: var(--faint); }
.form-control:disabled, .form-control[readonly], .aspNetDisabled.form-control { background-color: var(--soft); color: var(--text); }
textarea.form-control { height: auto; min-height: 76px; padding: 9px 12px; line-height: 1.5; }
input[type=date].form-control, input[type=month].form-control { padding-right: 8px; }
select.form-control:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M12 13.2l4.9-4.9 1.4 1.4-6.3 6.3-6.3-6.3 1.4-1.4z'/%3E%3C/svg%3E") no-repeat right 10px center; }
.form-control-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.input-group > .form-control { min-width: 0; }
.input-group-text { border: 1px solid var(--input); background: var(--soft); color: var(--muted); font-weight: 600; font-size: 13px; border-radius: 10px; }
.input-group > .input-group-prepend > .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-append > .input-group-text, .input-group > .input-group-append > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.custom-control-label { font-weight: 500; color: var(--text); font-size: 14px; padding-top: 1px; }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--brand); border-color: var(--brand); }
.custom-switch .custom-control-label::before { border-radius: 1rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; vertical-align: -3px; cursor: pointer; }
.help-block, .with-errors { font-size: 12px; color: var(--red); }
.help-block:empty, .with-errors:empty { display: none; }
.mc-req::after, label.required::after { content: ' *'; color: var(--red); }
.select { display: flex; flex-direction: column; }

/* select2 */
.select2-container { width: 100% !important; max-width: 100%; }
.select2-container--default .select2-selection--single { height: 40px; border: 1px solid var(--input); border-radius: 10px; background: var(--card); display: flex; align-items: center; padding: 0; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding: 0 34px 0 12px; color: var(--ink); font-size: 14px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--faint); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; right: 6px; top: 1px; }
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand); box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); }
.select2-container--default.select2-container--disabled .select2-selection--single { background: var(--soft); }
.select2-dropdown { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); overflow: hidden; z-index: 100050; }
.select2-container--open .select2-dropdown--below { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 12px; }
.select2-container--open .select2-dropdown--above { margin-top: -4px; border-bottom: 1px solid var(--line); border-radius: 12px; }
.select2-search--dropdown { padding: 8px; }
.select2-search--dropdown .select2-search__field { border: 1px solid var(--input) !important; border-radius: 8px; height: 36px; padding: 0 10px !important; outline: 0; font-size: 14px; width: 100% !important; }
.select2-results__option { padding: 8px 12px; font-size: 14px; }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--brand); }
.select2-container--default .select2-results__option[aria-selected=true], .select2-container--default .select2-results__option--selected { background: var(--brand-50); color: var(--brand-700); }
.select2-results > .select2-results__options { max-height: 300px; }
/* bootstrap-select is not loaded any more: keep the plain select usable */
select.selectpicker { display: block !important; }

/* ------------------------------------------------------------ tables */
.table { color: var(--text); margin-bottom: 0; font-size: 13.5px; }
.table thead th, .table thead td, .table tr.ligth th, table thead tr.ligth th { background: var(--soft); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; border-bottom: 1px solid var(--line) !important; border-top: 0 !important; padding: 10px 12px; white-space: nowrap; vertical-align: middle; }
.table td, .table th { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--line-2) !important; }
.table-hover tbody tr:hover, .table tbody tr:hover { background: #f7fcfe; }
.table-striped tbody tr:nth-of-type(odd) { background: var(--card); }
.table tfoot td, .table tfoot th { font-weight: 700; color: var(--ink); background: var(--soft); border-top: 2px solid var(--line) !important; }
.table-responsive { border-radius: var(--r); }
.table-light, .table-light > td, .table-light > th { background: var(--soft); }
table.mc-table { width: 100%; }
table.mc-table td.num, table.mc-table th.num { text-align: right; white-space: nowrap; }

/* DataTables (reports, admin) */
div.dataTables_wrapper div.dataTables_filter { text-align: right; margin-bottom: 10px; }
div.dataTables_wrapper div.dataTables_filter label { font-size: 0; display: inline-flex; align-items: center; }
div.dataTables_wrapper div.dataTables_filter input { width: 260px !important; max-width: 100%; height: 38px !important; border: 1px solid var(--input) !important; border-radius: 10px !important;
    padding: 0 12px 0 34px !important; font-size: 14px !important; margin: 0 !important;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M18 16.6l4.3 4.3-1.4 1.4-4.3-4.3A9 9 0 1 1 18 16.6zM11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z'/%3E%3C/svg%3E") no-repeat 10px center !important; }
div.dataTables_wrapper div.dataTables_filter input:focus { border-color: var(--brand) !important; outline: 0; box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); }
div.dataTables_wrapper div.dataTables_info { font-size: 12.5px; color: var(--muted); padding-top: 12px !important; }
div.dataTables_wrapper div.dataTables_paginate { padding-top: 8px; }
.page-item .page-link { border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px; margin: 0 2px; border-radius: 8px !important; min-width: 34px; text-align: center; }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-item.disabled .page-link { color: var(--faint); }
.dataTables_scrollHead { border-radius: var(--r) var(--r) 0 0; }
table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; border-collapse: collapse !important; }
table.dataTable thead .sorting:before, table.dataTable thead .sorting:after, table.dataTable thead .sorting_asc:before, table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before, table.dataTable thead .sorting_desc:after { bottom: .7em; }

/* ------------------------------------------------------------ modals / dropdowns / alerts / tabs */
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: var(--sh-3); }
.modal-header { border-bottom: 1px solid var(--line-2); padding: 14px 18px; align-items: center; }
.modal-header .modal-title { font-size: 16px; font-weight: 700; }
.modal-header .close { padding: 6px 10px; margin: -6px -8px -6px auto; font-size: 24px; opacity: .6; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--line-2); padding: 12px 18px; gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: .45; background: #0f172a; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; font-size: 14px; min-width: 200px; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; color: var(--text); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.dropdown-item i { font-size: 17px; color: var(--muted); width: 18px; text-align: center; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--soft); color: var(--ink); }
.dropdown-item.text-danger, .dropdown-item.text-danger i { color: var(--red) !important; }
.dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 8px 12px 4px; }
.dropdown-divider { border-top-color: var(--line-2); margin: 5px 0; }
.alert { border-radius: var(--r); border: 1px solid transparent; font-size: 14px; }
.alert-danger { background: var(--red-50); border-color: #fecaca; color: #991b1b; }
.alert-success { background: var(--green-50); border-color: #bbf7d0; color: #166534; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.alert-warning { background: var(--amber-50); border-color: #fde68a; color: #92400e; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; padding: 10px 14px; border-radius: 0; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.progress { border-radius: 99px; background: var(--line-2); }
.progress-bar { background: var(--brand); }

/* old label messages: the text now shows as a toast; keep the label quiet */
.mc-app span.error, .mc-app span.success, .mc-app label.error, .mc-app label.success, .mc-app [id$=lblError] { display: none !important; }
.iq-alert-text { font-size: 14px; }

/* =====================================================================
   App shell: top bar, slide-in menu (always hidden until opened), page
   ===================================================================== */
body.mc-app { padding-top: var(--top-h); min-height: 100vh; }
.mc-top { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 1030; display: flex; align-items: center; gap: 10px; padding: 0 18px 0 12px;
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.mc-top__menu { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
    color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; flex: 0 0 auto; }
.mc-top__menu i { font-size: 20px; }
.mc-top__menu:hover { background: var(--soft); border-color: var(--input); }
.mc-brand { display: flex; align-items: center; gap: 9px; text-decoration: none !important; flex: 0 0 auto; min-width: 0; }
.mc-brand img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.mc-brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.mc-brand__text b { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.mc-brand__text small { font-size: 10.5px; color: var(--muted); white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.mc-top__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.mc-hdr-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: inline-flex !important; align-items: center; justify-content: center;
    font-size: 19px; color: var(--ink) !important; position: relative; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s; padding: 0; }
.mc-hdr-btn:hover { background: var(--soft); border-color: var(--input); }
.mc-new-btn { height: 40px; border-radius: 10px; padding: 0 14px 0 11px; }
.mc-new-btn::after { display: none !important; }
.mc-fy-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line);
    color: var(--ink) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; white-space: nowrap; }
.mc-fy-chip i { color: var(--brand); font-size: 16px; }
.mc-fy-chip:hover { border-color: var(--brand-200); background: var(--brand-50); }
.mc-bell__n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #fff; }
.mc-user { display: inline-flex !important; align-items: center; gap: 8px; text-decoration: none !important; color: var(--ink) !important; padding: 3px 8px 3px 3px; border-radius: 12px;
    border: 1px solid transparent; }
.mc-user:hover { background: var(--soft); border-color: var(--line); }
.mc-user__avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; display: inline-flex;
    align-items: center; justify-content: center; font-size: 13px; flex: 0 0 34px; }
.mc-user__avatar--lg { width: 44px; height: 44px; flex-basis: 44px; font-size: 16px; border-radius: 12px; }
.mc-user__text { flex-direction: column; line-height: 1.2; max-width: 160px; }
.mc-user__text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-user__text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-profile { min-width: 280px; }
.mc-profile__head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.mc-profile__head b { display: block; color: var(--ink); font-size: 14.5px; }
.mc-profile__head small { display: block; color: var(--muted); font-size: 12px; }
.mc-profile__plan { color: var(--green) !important; font-weight: 600; margin-top: 2px; }
.mc-quick { min-width: 230px; }
.mc-plan-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 99px; background: var(--amber-50); color: var(--amber); font-weight: 700;
    font-size: 12.5px; white-space: nowrap; border: 1px solid #fde68a; }
.mc-plan-pill.is-bad { background: var(--red-50); color: var(--red); border-color: #fecaca; }

/* notifications drop-down */
.mc-notif { width: 370px; max-width: calc(100vw - 20px); padding: 0 !important; overflow: hidden; }
.mc-notif__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.mc-notif__head b { color: var(--ink); }
.mc-notif__head a { font-size: 12.5px; font-weight: 600; }
.mc-notif__list { max-height: 400px; overflow: auto; }
.mc-notif__item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none !important; color: var(--text) !important; }
.mc-notif__item:hover { background: var(--soft); }
.mc-notif__item.is-unread { background: #f2fbfe; }
.mc-notif__ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--brand-50); color: var(--brand); }
.mc-notif__item.k-Success .mc-notif__ico { background: var(--green-50); color: var(--green); }
.mc-notif__item.k-Warning .mc-notif__ico { background: var(--amber-50); color: var(--amber); }
.mc-notif__item.k-Danger .mc-notif__ico { background: var(--red-50); color: var(--red); }
.mc-notif__item b { display: block; font-size: 13.5px; color: var(--ink); }
.mc-notif__item p { margin: 1px 0 2px; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-notif__item small { font-size: 11.5px; color: var(--faint); }
.mc-notif__empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.mc-notif__all { display: block; text-align: center; padding: 11px; font-weight: 600; font-size: 13px; border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------ global search */
.mc-search { position: relative; flex: 1 1 auto; max-width: 620px; margin: 0 auto 0 14px; }
.mc-search__box { position: relative; display: flex; align-items: center; }
.mc-search__icon { position: absolute; left: 13px; font-size: 17px; color: var(--faint); pointer-events: none; }
.mc-search__input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); padding: 0 44px 0 38px; font-size: 14px; color: var(--ink); outline: 0;
    transition: border-color .15s, background .15s, box-shadow .15s; }
.mc-search__input:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); }
.mc-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.mc-search__kbd { position: absolute; right: 9px; font-size: 11px; background: var(--card); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 1px 7px; box-shadow: none; font-family: var(--font); }
.mc-search__spin { position: absolute; right: 40px; width: 16px; height: 16px; border: 2px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: mcspin .7s linear infinite; display: none; }
.mc-search.is-loading .mc-search__spin { display: block; }
@keyframes mcspin { to { transform: rotate(360deg); } }
.mc-search__back { display: none; border: 0; background: none; font-size: 22px; color: var(--ink); padding: 0 8px 0 0; }
.mc-search__panel { position: absolute; top: 46px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-3); max-height: 70vh; overflow: auto; z-index: 1060; padding: 6px; }
.mc-search__group { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px 4px; }
.mc-search__item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text) !important; text-decoration: none !important; }
.mc-search__item i { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 32px; }
.mc-search__item b { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-search__item small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-search__item span { min-width: 0; }
.mc-search__item.is-active, .mc-search__item:hover { background: var(--brand-50); }
.mc-search__empty { padding: 22px; text-align: center; color: var(--muted); }
.mc-search__item mark { background: #fef08a; padding: 0; border-radius: 2px; }
.mc-search-open { display: none !important; }

/* ------------------------------------------------------------ slide-in menu (drawer) */
.mc-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 330px; max-width: 88vw; z-index: 1050; background: var(--card); display: flex; flex-direction: column;
    transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 0 1px var(--line), 18px 0 50px rgba(15, 23, 42, .18); visibility: hidden; }
body.mc-drawer-open .mc-drawer { transform: none; visibility: visible; }
.mc-backdrop { position: fixed; inset: 0; z-index: 1045; background: rgba(15, 23, 42, .42); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.mc-drawer-open .mc-backdrop { opacity: 1; pointer-events: auto; }
body.mc-drawer-open { overflow: hidden; }
.mc-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.mc-drawer__search { position: relative; padding: 12px 14px 8px; }
.mc-drawer__search i { position: absolute; left: 27px; top: 50%; margin-top: 2px; transform: translateY(-50%); color: var(--faint); font-size: 17px; pointer-events: none; }
.mc-drawer__search input { width: 100%; height: 44px; border: 1.5px solid var(--brand-200); border-radius: 12px; background: var(--brand-50); padding: 0 12px 0 38px; font-size: 14.5px; color: var(--ink); outline: 0; }
.mc-drawer__search input:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); }
.mc-drawer__hint { font-size: 11.5px; color: var(--faint); padding: 0 16px 6px; }
.mc-drawer__nav { flex: 1 1 auto; overflow-y: auto; padding: 4px 10px 16px; overscroll-behavior: contain; }
.mc-nav-group { margin-top: 8px; }
.mc-nav-group__title { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px 4px; display: flex; align-items: center; gap: 6px; }
.mc-nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text) !important; font-weight: 500; font-size: 14px; text-decoration: none !important;
    transition: background .12s; }
.mc-nav-item i { font-size: 19px; width: 22px; text-align: center; color: var(--muted); flex: 0 0 22px; }
.mc-nav-item span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-nav-item:hover, .mc-nav-item.is-focus { background: var(--soft); color: var(--ink) !important; }
.mc-nav-item.is-focus { box-shadow: inset 0 0 0 1.5px var(--brand-200); }
.mc-nav-item.active { background: var(--brand-50); color: var(--brand-700) !important; font-weight: 600; }
.mc-nav-item.active i { color: var(--brand); }
.mc-nav-item mark { background: #fef08a; padding: 0; border-radius: 2px; }
.mc-menu-badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.mc-menu-none { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
.mc-drawer__foot { border-top: 1px solid var(--line-2); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; background: var(--soft); }
.mc-drawer__foot .mc-fy-input { border: 0; background: transparent; font-weight: 700; color: var(--ink); font-size: 13px; width: 120px; padding: 0; pointer-events: none; }
.mc-drawer__foot small { color: var(--muted); font-size: 11.5px; display: block; line-height: 1.1; }

/* ------------------------------------------------------------ page area */
.mc-main { padding: 20px 24px 40px; }
.mc-container { max-width: 1480px; margin: 0 auto; }
.mc-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.mc-crumb a { color: var(--muted) !important; text-decoration: none !important; }
.mc-crumb a:hover { color: var(--brand) !important; }
.mc-crumb > * + *::before { content: '/'; margin-right: 6px; color: #cbd5e1; }
.mc-crumb__here { color: var(--ink); font-weight: 600; }
.mc-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px; font-size: 13.5px; border: 1px solid transparent; }
.mc-banner > i { font-size: 20px; }
.mc-banner > span { flex: 1 1 260px; }
.mc-banner--warn { background: var(--amber-50); color: #92400e; border-color: #fde68a; }
.mc-banner--support { background: var(--violet-50); color: #4c1d95; border-color: #ddd6fe; }
.mc-banner--info { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.mc-banner--danger { background: var(--red-50); color: #991b1b; border-color: #fecaca; }

/* page header used by every page */
.mc-page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.mc-page-head__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mc-page-head__ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--brand-50); color: var(--brand); flex: 0 0 44px; }
.mc-page-head h1, .mc-page-head h4 { font-size: 22px; font-weight: 800; margin: 0; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.mc-page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mc-page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mc-back { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--ink) !important;
    font-size: 20px; text-decoration: none !important; flex: 0 0 38px; }
.mc-back:hover { background: var(--soft); }

/* ------------------------------------------------------------ toasts (every message in the app) */
.mc-toasts { position: fixed; top: calc(var(--top-h) + 12px); right: 16px; z-index: 100010; display: flex; flex-direction: column; gap: 10px; width: 380px; max-width: calc(100vw - 24px); pointer-events: none; }
.mc-toast-i { pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px;
    box-shadow: var(--sh-3); padding: 12px 10px 12px 13px; animation: mctoast .22s ease-out; }
.mc-toast-i.is-out { opacity: 0; transform: translateX(16px); transition: all .2s; }
.mc-toast-i__ico { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--green-50); color: var(--green); }
.mc-toast-i__msg { flex: 1 1 auto; font-size: 13.5px; color: var(--ink); font-weight: 500; padding-top: 3px; word-break: break-word; }
.mc-toast-i__msg b { display: block; font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.mc-toast-i__x { border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 2px 4px; cursor: pointer; }
.mc-toast-i__x:hover { color: var(--ink); }
.mc-toast-i--danger { border-left-color: var(--red); } .mc-toast-i--danger .mc-toast-i__ico { background: var(--red-50); color: var(--red); }
.mc-toast-i--warning { border-left-color: var(--amber); } .mc-toast-i--warning .mc-toast-i__ico { background: var(--amber-50); color: var(--amber); }
.mc-toast-i--info { border-left-color: var(--brand); } .mc-toast-i--info .mc-toast-i__ico { background: var(--brand-50); color: var(--brand); }
@keyframes mctoast { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* confirm dialog (replaces the browser confirm box on the new pages) */
.mc-confirm { position: fixed; inset: 0; z-index: 100020; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: mcfade .15s; }
.mc-confirm__box { background: var(--card); border-radius: 16px; box-shadow: var(--sh-3); width: 100%; max-width: 400px; padding: 22px; }
.mc-confirm__ico { width: 46px; height: 46px; border-radius: 12px; background: var(--red-50); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.mc-confirm__box h5 { margin: 0 0 4px; font-size: 17px; }
.mc-confirm__box p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.mc-confirm__btns { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes mcfade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ phone bottom bar + create sheet */
.mc-bottom-nav { display: none; }
.mc-sheet .modal-dialog { max-width: 460px; }
.mc-sheet .modal-content { border-radius: 18px; }
.mc-sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mc-sheet__grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 14px; font-size: 12.5px; font-weight: 600;
    color: var(--ink) !important; text-decoration: none !important; text-align: center; }
.mc-sheet__grid a i { font-size: 24px; color: var(--brand); }
.mc-sheet__grid a:hover { border-color: var(--brand-200); background: var(--brand-50); }

/* ------------------------------------------------------------ install app / offline */
.mc-pwa-bar { position: fixed; left: 10px; right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 995; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--sh-3); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.mc-pwa-bar img { width: 40px; height: 40px; border-radius: 10px; }
.mc-pwa-bar div { flex: 1 1 auto; line-height: 1.2; }
.mc-pwa-bar b { display: block; color: var(--ink); font-size: 14px; }
.mc-pwa-bar span { font-size: 12px; color: var(--muted); }
.mc-pwa-bar__x { border: 0; background: none; font-size: 24px; color: var(--muted); line-height: 1; }
.mc-pwa-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100002; display: flex; align-items: center; justify-content: center; padding: 16px; }
.mc-pwa-modal__box { background: var(--card); border-radius: 18px; padding: 22px; max-width: 380px; width: 100%; text-align: center; }
.mc-pwa-modal__box img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 10px; }
.mc-pwa-modal__box ol { text-align: left; padding-left: 20px; color: var(--text); font-size: 14px; }
.mc-pwa-modal__box ol li { margin-bottom: 6px; }
.mc-net { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 100004; display: flex; align-items: center; gap: 10px; background: #1e293b; color: #fff;
    border-radius: 999px; padding: 8px 8px 8px 16px; font-size: 13px; box-shadow: var(--sh-3); max-width: calc(100vw - 20px); }
.mc-net i { font-size: 17px; color: #fbbf24; }
.mc-net.is-online i { color: #4ade80; }
.mc-net button { border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 12.5px; }
.mc-sync-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--amber); color: #fff; font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #fff; }

/* ------------------------------------------------------------ responsive shell */
@media (max-width: 1199px) {
    .mc-fy-chip span { display: none; }
}
@media (max-width: 991px) {
    :root { --top-h: 58px; }
    .mc-top { padding: 0 10px; gap: 6px; }
    .mc-top__menu { width: 40px; padding: 0; justify-content: center; }
    .mc-top__menu span, .mc-brand__text small, .mc-fy-chip, .mc-new-btn span { display: none; }
    .mc-new-btn { width: 40px; padding: 0; }
    .mc-search { display: none; margin: 0; max-width: none; }
    .mc-search-open { display: inline-flex !important; }
    .mc-search.is-open { display: block; position: fixed; inset: 0; z-index: 100000; background: var(--card); padding: 10px 12px; }
    .mc-search.is-open .mc-search__back { display: inline-block; }
    .mc-search.is-open .mc-search__icon { left: 44px; }
    .mc-search.is-open .mc-search__panel { position: static; box-shadow: none; border: 0; max-height: calc(100vh - 70px); margin-top: 6px; }
    .mc-search__kbd { display: none; }
    .mc-user__text, .mc-user > .ri-arrow-down-s-line { display: none !important; }
    .mc-user { padding: 2px; }
    .mc-main { padding: 14px 12px 100px; }
    .mc-page-head h1, .mc-page-head h4 { font-size: 19px; }
    .mc-page-head__ico { display: none; }
    .mc-bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; background: var(--card); border-top: 1px solid var(--line);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15, 23, 42, .06); }
    .mc-bottom-nav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; font-weight: 600; color: var(--muted) !important; text-decoration: none !important; padding: 3px 0; }
    .mc-bottom-nav a i { font-size: 21px; }
    .mc-bottom-nav a.is-active { color: var(--brand) !important; }
    .mc-bottom-nav a.mc-bottom-nav__main i { width: 48px; height: 48px; border-radius: 16px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
        margin-top: -24px; box-shadow: 0 8px 20px rgba(50, 189, 234, .4); font-size: 24px; }
    .mc-toasts { top: auto; bottom: calc(78px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }
    .mc-net { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
    .mc-brand__text b { font-size: 16px; }
    .mc-plan-pill span { display: none; }
    .mc-plan-pill { padding: 0 9px; }
}

/* =====================================================================
   Paged list screens (Quotations, Invoices, Customers ... ) - mc-list.js
   ===================================================================== */
.mc-lv__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mc-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh-1); display: flex; gap: 12px; align-items: center; min-width: 0; }
.mc-stat__ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--brand-50); color: var(--brand); flex: 0 0 40px; }
.mc-stat--green .mc-stat__ico { background: var(--green-50); color: var(--green); }
.mc-stat--orange .mc-stat__ico { background: var(--accent-50); color: var(--accent); }
.mc-stat--violet .mc-stat__ico { background: var(--violet-50); color: var(--violet); }
.mc-stat--red .mc-stat__ico { background: var(--red-50); color: var(--red); }
.mc-stat--amber .mc-stat__ico { background: var(--amber-50); color: var(--amber); }
.mc-stat--teal .mc-stat__ico { background: var(--teal-50); color: var(--teal); }
.mc-stat__body { min-width: 0; }
.mc-stat__label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-stat__value { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

.mc-lv__card { padding: 0; overflow: visible; }
.mc-lv__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.mc-lv__search { position: relative; flex: 1 1 260px; max-width: 420px; }
.mc-lv__search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 17px; pointer-events: none; }
.mc-lv__search input { width: 100%; height: 40px; border: 1px solid var(--input); border-radius: 10px; padding: 0 34px 0 36px; font-size: 14px; color: var(--ink); outline: 0; background: var(--card); }
.mc-lv__search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(50, 189, 234, .18); }
.mc-lv__search .mc-lv__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); font-size: 18px; padding: 4px; display: none; cursor: pointer; }
.mc-lv__search.has-value .mc-lv__clear { display: block; }
.mc-lv__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.mc-lv__tools .form-control { height: 38px; width: auto; font-size: 13.5px; }
.mc-lv__dates { display: none; align-items: center; gap: 6px; }
.mc-lv__dates.is-on { display: inline-flex; }
.mc-lv__dates input { width: 148px !important; }
.mc-lv__chips { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.mc-lv__chips::-webkit-scrollbar { display: none; }
.mc-lv__chips:empty { display: none; }
.mc-fchip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.mc-fchip small { font-size: 11px; color: var(--muted); background: var(--line-2); border-radius: 99px; padding: 0 6px; font-weight: 700; }
.mc-fchip:hover { border-color: var(--input); background: var(--soft); }
.mc-fchip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mc-fchip.is-on small { background: rgba(255, 255, 255, .2); color: #fff; }

.mc-lv__body { position: relative; min-height: 180px; }
.mc-lv__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.mc-lv__table th { position: sticky; top: var(--top-h); z-index: 2; background: var(--soft); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; user-select: none; }
.mc-lv__table th.is-sort { cursor: pointer; }
.mc-lv__table th.is-sort:hover { color: var(--ink); }
.mc-lv__table th .mc-sort-ico { font-size: 13px; vertical-align: -2px; opacity: .35; margin-left: 2px; }
.mc-lv__table th.is-sorted { color: var(--brand); }
.mc-lv__table th.is-sorted .mc-sort-ico { opacity: 1; }
.mc-lv__table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--text); }
.mc-lv__table tbody tr { transition: background .1s; }
.mc-lv__table tbody tr:hover { background: #f7fcfe; }
.mc-lv__table tbody tr.is-click { cursor: pointer; }
.mc-lv__table tbody tr:last-child td { border-bottom: 0; }
.mc-lv__table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-lv__table th.num { text-align: right; }
.mc-lv__table .mc-strong { font-weight: 600; color: var(--ink); }
.mc-lv__table .mc-amt { font-weight: 700; color: var(--ink); }
.mc-lv__table .mc-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.mc-lv__table td.mc-act-cell { text-align: right; white-space: nowrap; width: 1%; padding-right: 14px; }
.mc-lv__table th.mc-act-cell { text-align: right; padding-right: 14px; }
.mc-docno { font-weight: 700; color: var(--brand) !important; text-decoration: none !important; }
.mc-docno:hover { text-decoration: underline !important; }
.mc-avatar { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: 0 0 32px;
    background: var(--brand-50); color: var(--brand-600); }
.mc-party { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-party > span { min-width: 0; }
.mc-party b { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.mc-party small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

.mc-acts { display: inline-flex; gap: 4px; align-items: center; }
.mc-act { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; cursor: pointer; text-decoration: none !important; transition: all .12s; padding: 0; }
.mc-act:hover { background: var(--line-2); color: var(--ink); }
.mc-act--primary { color: var(--brand); }
.mc-act--primary:hover { background: var(--brand-50); color: var(--brand-700); }
.mc-act--danger:hover { background: var(--red-50); color: var(--red); }
.mc-act.dropdown-toggle::after { display: none; }
.mc-acts .dropdown-menu { min-width: 210px; }

/* mobile cards */
.mc-lv__cards { display: none; }
.mc-card-row { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--text) !important; text-decoration: none !important; position: relative; }
.mc-card-row:last-child { border-bottom: 0; }
.mc-card-row:active { background: var(--soft); }
.mc-card-row__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-card-row__title { font-weight: 700; color: var(--ink); font-size: 14.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-card-row__amt { font-weight: 800; color: var(--ink); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-card-row__mid { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; font-size: 13px; color: var(--text); }
.mc-card-row__mid > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-card-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.mc-card-row__meta i { font-size: 13px; vertical-align: -2px; }
.mc-card-row__acts { display: flex; gap: 6px; margin-top: 10px; }
.mc-card-row__acts .btn { flex: 1 1 0; height: 34px; font-size: 12.5px; padding: 0 8px; }
.mc-card-row__acts .dropdown { flex: 0 0 auto; }

/* states */
.mc-lv__empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.mc-lv__empty i { font-size: 44px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.mc-lv__empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.mc-lv__empty p { margin: 0 0 14px; font-size: 13.5px; }
.mc-skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%); background-size: 400% 100%; animation: mcskel 1.2s ease infinite; }
@keyframes mcskel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.mc-lv__loading { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; display: none; z-index: 3; }
.mc-lv__loading::before { content: ''; position: absolute; left: -40%; width: 40%; height: 100%; background: var(--brand); animation: mcbar 1s ease-in-out infinite; }
.mc-lv.is-busy .mc-lv__loading { display: block; }
.mc-lv.is-busy .mc-lv__table tbody, .mc-lv.is-busy .mc-lv__cards { opacity: .55; transition: opacity .15s; }
@keyframes mcbar { 0% { left: -40%; } 100% { left: 100%; } }

.mc-lv__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); background: var(--soft);
    border-radius: 0 0 var(--r) var(--r); font-size: 13px; color: var(--muted); }
.mc-lv__foot b { color: var(--ink); }
.mc-pager { display: flex; align-items: center; gap: 4px; }
.mc-pager button { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: 13px; padding: 0 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; }
.mc-pager button:hover:not(:disabled) { border-color: var(--input); background: var(--soft); }
.mc-pager button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-pager button:disabled { opacity: .45; cursor: default; }
.mc-pager .mc-pager__gap { padding: 0 4px; color: var(--faint); }
.mc-lv__size { display: inline-flex; align-items: center; gap: 6px; }
.mc-lv__size select { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 26px 0 8px; font-size: 13px; background-position: right 6px center; }

@media (max-width: 767px) {
    .mc-lv__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mc-stat { padding: 10px 12px; gap: 10px; }
    .mc-stat__ico { width: 34px; height: 34px; flex-basis: 34px; font-size: 17px; }
    .mc-stat__value { font-size: 16px; }
    .mc-lv__bar { padding: 10px 12px; gap: 8px; }
    .mc-lv__search { max-width: none; flex-basis: 100%; }
    .mc-lv__tools { margin-left: 0; width: 100%; }
    .mc-lv__tools > select.form-control { flex: 1 1 0; width: auto; min-width: 0; }
    .mc-lv__dates.is-on { display: flex; width: 100%; }
    .mc-lv__dates input { width: auto !important; flex: 1 1 0; }
    .mc-lv__chips { padding: 8px 12px 0; }
    .mc-lv__table { display: none; }
    .mc-lv__cards { display: block; }
    .mc-lv__foot { padding: 10px 12px; justify-content: center; }
    .mc-lv__info { width: 100%; text-align: center; }
    .mc-lv__size { display: none; }
}

/* =====================================================================
   Add / edit screens (masters, users, company ...)
   ===================================================================== */
.mc-form-page { max-width: 1100px; margin: 0 auto; }
.mc-form-page--wide { max-width: none; }
.mc-fcard { overflow: visible; }
.mc-fcard__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.mc-fcard__head > i { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 36px; }
.mc-fcard__head h3 { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); }
.mc-fcard__head p { font-size: 12.5px; color: var(--muted); margin: 1px 0 0; }
.mc-fcard .card-body { padding: 18px 18px 6px; }
.mc-fcard .card-body > .row { margin-left: -8px; margin-right: -8px; }
.mc-fcard .card-body > .row > [class*=col] { padding-left: 8px; padding-right: 8px; }
.mc-fcard .card-body h5, .mc-fcard .card-body h4 { font-size: 14px; }
.mc-savebar { position: sticky; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin: 6px 0 0;
    background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 -6px 24px rgba(15, 23, 42, .07); }
.mc-savebar .btn { min-width: 110px; height: 42px; }
.mc-savebar__total { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.mc-savebar__total small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.mc-savebar__total b { font-size: 22px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mc-savebar__hint { font-size: 12px; color: var(--muted); }
.mc-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; background: var(--card); }
.mc-switch-row b { display: block; color: var(--ink); font-size: 14px; }
.mc-switch-row small { color: var(--muted); font-size: 12.5px; }
.checkbox-wrap, .checkbox, .radio { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkbox-wrap label, .checkbox label, .radio label { margin: 0; font-weight: 500; color: var(--text); font-size: 13.5px; cursor: pointer; }
.custom-file-label { border-radius: 10px; height: 40px; line-height: 26px; border-color: var(--input); }
.custom-file-label::after { height: 38px; line-height: 26px; border-radius: 0 10px 10px 0; }

/* profile header on the user screen */
.mc-profile-hero { display: flex; align-items: center; gap: 16px; padding: 18px; background: linear-gradient(120deg, var(--brand-50), #fff 60%); border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 16px; flex-wrap: wrap; }
.mc-profile-hero .mc-user__avatar { width: 60px; height: 60px; flex-basis: 60px; border-radius: 16px; font-size: 22px; }
.mc-profile-hero h2 { font-size: 20px; margin: 0; }
.mc-profile-hero p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mc-profile-hero__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* =====================================================================
   Quotation / Sales / Purchase invoice screens
   ===================================================================== */
.mc-doc2__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.mc-doc2__main { min-width: 0; }
.mc-doc2__side { position: sticky; top: calc(var(--top-h) + 14px); display: flex; flex-direction: column; gap: 12px; }
.mc-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); margin-bottom: 16px; }
.mc-sec__head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.mc-sec__no { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px; }
.mc-sec__head h3 { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); }
.mc-sec__head p { margin: 0 0 0 auto; font-size: 12.5px; color: var(--muted); }
.mc-sec__body { padding: 16px 18px 4px; }
.mc-sec__body > .row { margin-left: -7px; margin-right: -7px; }
.mc-sec__body > .row > [class*=col] { padding-left: 7px; padding-right: 7px; }
.mc-sec__body .or-detail { background: var(--soft); border: 1px dashed var(--input); border-radius: 12px; padding: 12px 6px 2px; margin: 0 0 14px !important; }
.mc-sec__body .or-detail > .col-md-12 > h5 { display: none; }
.mc-sec__body > .row.d-none, .mc-sec__body .col-md-12.d-none { display: none !important; }
.mc-items-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.mc-items-wrap #tblProducts, #tblProducts { margin: 0; border: 0 !important; min-width: 720px; }
#tblProducts thead th { background: var(--soft); font-size: 11px; position: static; }
#tblProducts td { font-size: 13px; padding: 8px 10px; }
#tblProducts tbody tr:nth-child(even) { background: #fbfdfe; }
.mc-items-wrap:has(tbody:empty)::after { content: 'No items added yet'; display: block; padding: 26px; color: var(--muted); text-align: center; font-size: 13px; position: sticky; left: 0; }
.mc-sec__body .or-detail > .col-md-1 { flex: 1 1 78px; max-width: none; }
.mc-sec__body .or-detail > .col-md-2 { flex: 1 1 140px; max-width: none; }
.mc-sec__body .or-detail > .col-md-4 { flex: 2 1 240px; max-width: none; }
.mc-sec__body .or-detail label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.mc-sec__body .or-detail .btn { width: 100%; height: 40px; }
.mc-sum { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.mc-sum__head { padding: 12px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; }
.mc-sum__head h3 { font-size: 14.5px; font-weight: 700; margin: 0; }
.mc-sum__head i { color: var(--brand); font-size: 18px; }
.mc-sum__body { padding: 12px 16px 6px; }
.mc-sum__body > .row { margin: 0 -6px !important; background: transparent !important; border: 0 !important; padding: 0 !important; }
.mc-sum__body > .row > [class*=col] { padding-left: 6px; padding-right: 6px; }
.mc-sum__body .row > .col-md-12 > h5 { display: none; }
.mc-sum__body label { font-size: 12px; }
.mc-sum__body .form-control { height: 36px; font-size: 13.5px; }
.mc-sum__body .input-group-text { font-size: 12px; min-width: 52px; }
.mc-sum .mc-subtotal, .mc-sum__total { display: flex !important; justify-content: space-between; align-items: center; padding: 12px 16px !important; margin: 0 !important;
    background: var(--soft); border-top: 1px solid var(--line-2); border-radius: 0 !important; }
.mc-sum .mc-subtotal h6, .mc-sum__total h6 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.mc-sum .mc-subtotal h4, .mc-sum .mc-subtotal h5, .mc-sum .mc-subtotal span { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.mc-sum__total { background: var(--ink) !important; border-top: 0; }
.mc-sum__total h6 { color: #cbd5e1 !important; text-transform: uppercase; letter-spacing: .05em; font-size: 12px !important; }
.mc-sum__total h4, .mc-sum__total h5, .mc-sum__total span, .mc-sum__total .text-primary { color: #fff !important; font-size: 22px !important; font-weight: 800 !important; margin: 0; }
.mc-sum-mini { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; font-size: 13px; }
.mc-sum-mini span { color: var(--muted); }
.mc-sum-mini b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-doc2__bar { position: sticky; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; margin-top: 4px;
    background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 -8px 24px rgba(15, 23, 42, .08); }
.mc-doc2__bar .btn { height: 42px; min-width: 110px; }
.mc-doc2__bar .text-muted { color: var(--muted); }
.mc-doc2 .help-block { margin-top: 2px; }
.mc-doc2 .modal .modal-dialog.mc-slide { margin: 0 0 0 auto; height: 100%; max-width: 560px; }
.mc-doc2 .modal.fade .modal-dialog.mc-slide { transform: translateX(40px); }
.mc-doc2 .modal.show .modal-dialog.mc-slide { transform: none; }
.mc-doc2 .modal .modal-dialog.mc-slide .modal-content { height: 100%; border-radius: 16px 0 0 16px; overflow-y: auto; }
.mc-doc-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-doc-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; }
.mc-doc-steps span b { width: 20px; height: 20px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.mc-doc-total { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.mc-doc-total small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.mc-doc-total b { font-size: 22px; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 1199px) {
    .mc-doc2__grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 991px) {
    .mc-doc2__grid { grid-template-columns: minmax(0, 1fr); }
    .mc-doc2__side { position: static; }
    .mc-doc2__bar, .mc-savebar { bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 12px; }
    .mc-doc2__bar .btn, .mc-savebar .btn { flex: 1 1 auto; min-width: 0; }
    .mc-doc2__bar .mc-doc-total, .mc-savebar__total { order: -1; width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
    .mc-sec__body { padding: 14px 12px 2px; }
    .mc-sec__head { padding: 12px; }
    .mc-doc2 .modal .modal-dialog.mc-slide { max-width: none; margin: 0; }
    .mc-doc2 .modal .modal-dialog.mc-slide .modal-content { border-radius: 0; }
}

/* =====================================================================
   Payment in / out (Debit Collection) with many payment modes
   ===================================================================== */
.mc-pay__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.mc-pay__lines { display: flex; flex-direction: column; gap: 10px; }
.mc-pay-line { display: grid; grid-template-columns: 170px 150px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.mc-pay-line label { font-size: 11.5px; margin-bottom: 3px; }
.mc-pay-line .form-control { height: 38px; }
.mc-pay-line .mc-act { width: 38px; height: 38px; }
.mc-modes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mc-modes button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mc-modes button i { font-size: 16px; color: var(--brand); }
.mc-modes button:hover { border-color: var(--brand-200); background: var(--brand-50); }
.mc-party-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.mc-party-card .mc-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 15px; border-radius: 12px; }
.mc-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.mc-bal div { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.mc-bal small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.mc-bal b { font-size: 14.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-bal .is-due b { color: var(--red); }
@media (max-width: 991px) {
    .mc-pay__grid { grid-template-columns: minmax(0, 1fr); }
    .mc-pay-line { grid-template-columns: 1fr 1fr; }
    .mc-pay-line > :nth-child(3), .mc-pay-line > :nth-child(4) { grid-column: span 1; }
    .mc-pay-line > :last-child { grid-column: span 2; }
    .mc-pay-line > :last-child .mc-act { width: 100%; }
}
.mc-container:has(> .mc-form-page:not(.mc-form-page--wide)) > .mc-crumb { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* =====================================================================
   Dashboard, reports, notifications, super admin widgets
   ===================================================================== */
.mc-hello { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.mc-hello h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.mc-hello p { margin: 2px 0 0; color: var(--muted); }
.mc-hello__fy { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 12px; }
.mc-hello__fy label { margin: 0; white-space: nowrap; color: var(--muted); }
.mc-hello__fy select { min-width: 170px; border: 0 !important; box-shadow: none !important; height: 36px; font-weight: 600; }
.mc-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mc-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 16px; display: flex; gap: 12px; align-items: flex-start;
    text-decoration: none !important; color: var(--text) !important; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
a.mc-kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand-200); }
.mc-kpi__ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex: 0 0 42px; background: var(--brand-50); color: var(--brand); }
.mc-kpi--green .mc-kpi__ico { background: var(--green-50); color: var(--green); }
.mc-kpi--orange .mc-kpi__ico { background: var(--accent-50); color: var(--accent); }
.mc-kpi--violet .mc-kpi__ico { background: var(--violet-50); color: var(--violet); }
.mc-kpi--red .mc-kpi__ico { background: var(--red-50); color: var(--red); }
.mc-kpi--amber .mc-kpi__ico { background: var(--amber-50); color: var(--amber); }
.mc-kpi__body { min-width: 0; }
.mc-kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mc-kpi__value { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mc-kpi__sub { font-size: 12px; color: var(--muted); }
.mc-kpi__sub .up { color: var(--green); font-weight: 700; }
.mc-kpi__sub .down { color: var(--red); font-weight: 700; }
.mc-quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mc-quick-actions a { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 600; font-size: 13.5px;
    color: var(--ink) !important; text-decoration: none !important; transition: all .15s; box-shadow: var(--sh-1); }
.mc-quick-actions a i { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 34px; }
.mc-quick-actions a:nth-child(2) i { background: var(--green-50); color: var(--green); }
.mc-quick-actions a:nth-child(3) i { background: var(--accent-50); color: var(--accent); }
.mc-quick-actions a:nth-child(4) i { background: var(--teal-50); color: var(--teal); }
.mc-quick-actions a:nth-child(5) i { background: var(--violet-50); color: var(--violet); }
.mc-quick-actions a:hover { border-color: var(--brand-200); transform: translateY(-1px); }
.mc-list { list-style: none; margin: 0; padding: 0; }
.mc-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.mc-list li:last-child { border-bottom: 0; }
.mc-list .mc-list__main { flex: 1 1 auto; min-width: 0; }
.mc-list .mc-list__main b { display: block; color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-list .mc-list__main small { color: var(--muted); font-size: 12px; }
.mc-list .mc-list__amt { font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-list a { text-decoration: none !important; }
.mc-empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 13.5px; }
.mc-empty i { display: block; font-size: 32px; color: #cbd5e1; margin-bottom: 6px; }
.mc-chart { min-height: 300px; }
.mc-report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mc-report-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none !important; color: var(--text) !important;
    box-shadow: var(--sh-1); transition: all .15s; }
.mc-report-card:hover { border-color: var(--brand-200); transform: translateY(-2px); box-shadow: var(--sh-2); }
.mc-report-card i { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.mc-report-card b { display: block; color: var(--ink); font-size: 14.5px; }
.mc-report-card small { color: var(--muted); font-size: 12.5px; }
.mc-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 22px 0 10px; }
.mc-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mc-filter > div { flex: 1 1 160px; max-width: 240px; }
.mc-filter .btn { height: 40px; }
.mc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-tabs a, .mc-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--text) !important;
    text-decoration: none !important; cursor: pointer; }
.mc-tabs .active { background: var(--ink); border-color: var(--ink); color: #fff !important; }

/* =====================================================================
   Sign in / register (public pages)
   ===================================================================== */
.mc-public { min-height: 100vh; display: flex; background: var(--card); font-family: var(--font); color: var(--text); line-height: 1.5; }
.mc-public__side { flex: 1 1 52%; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
    background: radial-gradient(900px 500px at 0% 0%, #5fd0f2 0%, transparent 60%), linear-gradient(150deg, #32BDEA 0%, #1a9cc9 50%, #0E4A5A 100%); color: #e6f7fd; }
.mc-public__side::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: rgba(249, 115, 22, .22); filter: blur(10px); }
.mc-public__side .mc-brand__text b { color: #fff; }
.mc-public__side .mc-brand__text small { color: #d9f3fc; max-width: none; font-size: 12px; }
.mc-public__side .mc-brand img { background: var(--card); padding: 3px; }
.mc-public__side h1 { font-size: 38px; font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1.12; margin: 28px 0 14px; max-width: 560px; }
.mc-public__side h1 span { color: #ffd2bd; }
.mc-public__side p.lead { font-size: 16px; color: #d9f3fc; max-width: 520px; }
.mc-public__feat { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; position: relative; z-index: 1; }
.mc-public__feat li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: #f0fbff; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px; padding: 10px 12px; }
.mc-public__feat li i { color: #86efac; font-size: 18px; }
.mc-public__main { flex: 1 1 48%; display: flex; align-items: center; justify-content: center; padding: 28px 16px; background: var(--bg); }
.mc-auth { width: 100%; max-width: 440px; background: var(--card); border-radius: 20px; box-shadow: var(--sh-2); padding: 32px 30px; border: 1px solid var(--line); }
.mc-auth--wide { max-width: 640px; }
.mc-auth h2 { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0 0 4px; letter-spacing: -.02em; }
.mc-auth .sub { color: var(--muted); margin-bottom: 20px; }
.mc-auth label { font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.mc-auth .form-control { height: 46px; border-radius: 12px; font-size: 15px; }
.mc-auth .btn-primary { height: 48px; border-radius: 12px; font-weight: 700; font-size: 15.5px; width: 100%; }
.mc-auth .mc-pass { position: relative; }
.mc-auth .mc-pass .form-control { padding-right: 44px; }
.mc-auth .mc-pass button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 19px; padding: 6px; }
.mc-auth__msg { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.mc-auth__msg.err { background: var(--red-50); color: #991b1b; }
.mc-auth__msg.ok { background: var(--green-50); color: #166534; }
.mc-auth__msg.info { background: var(--brand-50); color: var(--brand-700); }
.mc-auth__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 13.5px; }
.mc-auth__links a { font-weight: 600; text-decoration: none; }
.mc-auth__reg { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--brand-200); background: var(--brand-50);
    text-decoration: none !important; color: var(--ink) !important; }
.mc-auth__reg i { font-size: 24px; color: var(--brand); }
.mc-auth__reg b { display: block; font-size: 14px; }
.mc-auth__reg small { color: var(--muted); }
.mc-auth__app { display: flex; gap: 16px; justify-content: center; margin-top: 16px; font-size: 13px; }
.mc-auth__app a { color: var(--muted); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.mc-public__foot { font-size: 12px; color: var(--muted); margin-top: 26px; }
@media (max-width: 991px) {
    .mc-public { flex-direction: column; background: var(--bg); }
    .mc-public__side { padding: 22px 20px 70px; flex: 0 0 auto; }
    .mc-public__side h1 { font-size: 24px; margin: 18px 0 0; }
    .mc-public__side .mc-public__feat, .mc-public__side p.lead { display: none; }
    .mc-public__main { padding: 0 12px 30px; align-items: flex-start; margin-top: -52px; position: relative; z-index: 2; background: transparent; }
    .mc-auth { padding: 22px 18px; border-radius: 18px; }
}

/* =====================================================================
   Older pages (reports, stock, production ...): their markup restyled
   ===================================================================== */
.mc-main .col-sm-12 > .d-flex.flex-wrap.align-items-center.justify-content-between,
.mc-main .col-lg-12 > .d-flex.flex-wrap.align-items-center.justify-content-between { gap: 10px; margin-bottom: 14px !important; }
.mc-main .d-flex.flex-wrap.align-items-center.justify-content-between > div > h4,
.mc-main .d-flex.flex-wrap.align-items-center.justify-content-between h4.mb-3 { font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 0 !important; letter-spacing: -.02em; }
.add-list { display: inline-flex; align-items: center; gap: 6px; }
.or-detail { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; }
.mc-subtotal { background: var(--brand-50); border-radius: 12px; margin-top: 10px; gap: 10px; }
.mc-subtotal h6 { margin: 0; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.mc-subtotal h4 { margin: 0; }
.note { font-size: 12px; margin-top: 4px; color: var(--muted); }
.note img { width: 14px; }
.export-btn, .ExportToExcel { display: inline-flex; }
.iq-alert { border-radius: 12px; }
.data-tables, .table-responsive { background: var(--card); }
.card .table-responsive { border-radius: 0 0 var(--r) var(--r); }
.rounded { border-radius: 10px !important; }
.border { border-color: var(--line) !important; }
.autocomplete-suggestions { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-3); overflow: auto; }
.autocomplete-suggestions > div { padding: 8px 12px; cursor: pointer; }
.autocomplete-suggestions > div:hover { background: var(--brand-50); }

/* ------------------------------------------------------------ phones */
@media (max-width: 991px) {
    .form-control, input.form-control[type=date], .select2-container--default .select2-selection--single .select2-selection__rendered { font-size: 16px; } /* no zoom on iPhone */
    .mc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mc-kpi { padding: 12px; flex-direction: column; gap: 8px; }
    .mc-kpi__value { font-size: 18px; }
    .mc-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .mc-quick-actions a { flex-direction: column; text-align: center; font-size: 12px; padding: 10px 6px; gap: 6px; }
    .mc-hello h1 { font-size: 20px; }
    .mc-hello__fy { width: 100%; }
    .mc-hello__fy select { flex: 1 1 auto; }
    .modal-dialog.modal-xl, .modal-dialog.modal-lg { max-width: none; margin: 0; min-height: 100%; }
    .modal-dialog.modal-xl .modal-content, .modal-dialog.modal-lg .modal-content { border-radius: 0; min-height: 100vh; }
    .card-body { padding: 14px; }
    .card-footer:has(.btn-primary) { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; background: rgba(255, 255, 255, .97); }
    .card-footer .btn { flex: 1 1 auto; }
}
@media (max-width: 575px) {
    .mc-doc-steps { display: none; }
    .mc-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .mc-tabs a, .mc-tabs button { white-space: nowrap; }
}

/* ------------------------------------------------------------ print */
@media print {
    body.mc-app { padding: 0; background: var(--card); }
    .mc-top, .mc-drawer, .mc-backdrop, .mc-bottom-nav, .mc-crumb, .mc-banner, .mc-pwa-bar, .mc-no-print, .dataTables_filter, .dataTables_paginate, .mc-toasts, .mc-savebar, .mc-doc2__bar,
    .mc-lv__bar, .mc-lv__foot, .mc-lv__chips, .mc-acts, .mc-act-cell, .mc-net { display: none !important; }
    .mc-main { padding: 0; }
    .card, .mc-sec, .mc-stat { box-shadow: none !important; }
    .mc-lv__table { display: table !important; }
    .mc-lv__cards { display: none !important; }
    .mc-lv__table th { position: static; }
}

/* hidden always wins */
.mc-app [hidden], .mc-hdr-btn[hidden] { display: none !important; }

/* =====================================================================
   AutoDeal look (same as the AutoDeal-Solution project, geo-design.css):
   cyan #32BDEA, navy ink, Lato, bordered cards (no shadow), 44px inputs,
   bold buttons, light uppercase table heads, pill badges
   ===================================================================== */
body { font-size: 14px; color: var(--text); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }

/* buttons */
.btn { font-weight: 700; font-size: 13.5px; border-radius: 10px; min-height: 42px; padding: 0 16px; gap: 7px; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 48px; }
.btn-primary { box-shadow: 0 4px 12px rgba(50, 189, 234, .35) !important; }
.btn-primary:disabled, .btn-primary.aspNetDisabled { box-shadow: none !important; }
.btn-light, .btn-secondary, .btn-default, .btn-outline-primary, a.btn-danger { background: var(--card); border: 1px solid var(--line); color: var(--ink) !important; }
.btn-light:hover, .btn-secondary:hover, a.btn-danger:hover { background: var(--soft); border-color: #bfe0ec; }
input.btn-danger, button.btn-danger { background: var(--red-50); border: 1px solid #f5c9c9; color: var(--red) !important; }
input.btn-danger:hover, button.btn-danger:hover { background: #fbdcdc; }
.btn-success, .btn-info { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-600) !important; }
.btn-success:hover, .btn-info:hover { background: var(--brand-100); border-color: #b5e6f6; }
.btn-warning { background: var(--amber-50); border: 1px solid #f1d38f; color: #8a5d00 !important; }
.btn-outline-danger { border-color: #f5c9c9; color: var(--red) !important; }

/* ONE export (Excel) button for the whole application */
.mc-btn-export, [id$=btnExport], .btn.export-btn, [data-x=export], #mcRptExcel {
    background: var(--card) !important; border: 1px solid var(--line) !important; color: var(--ink) !important; box-shadow: none !important;
    font-weight: 700 !important; min-height: 42px; border-radius: 10px !important; display: inline-flex !important; align-items: center; gap: 7px; padding: 0 14px !important; }
.mc-btn-export i, [id$=btnExport] i, .btn.export-btn i, [data-x=export] i, #mcRptExcel i { color: #1d7a46 !important; font-size: 17px; }
.mc-btn-export:hover, [id$=btnExport]:hover, .btn.export-btn:hover, [data-x=export]:hover, #mcRptExcel:hover { background: var(--soft) !important; border-color: #bfe0ec !important; }
[id$=btnExport] .la-download::before { content: "\f1c3"; }

/* forms */
label, .control-label, .col-form-label { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.custom-control-label, .checkbox label, .radio label, .checkbox-wrap label { font-weight: 600; color: var(--text); }
.form-control { height: 44px; border-color: var(--input); border-radius: 10px; color: var(--text); }
.form-control::placeholder { color: #9ab0ba; }
.form-control:disabled, .form-control[readonly] { background-color: #f6f9fa; }
.select2-container--default .select2-selection--single { height: 44px; border-color: var(--input); border-radius: 10px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; color: var(--text); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
.mc-sum__body .form-control { height: 40px; }
.mc-pay-line .form-control { height: 42px; }

/* the drop-down list of select2 is placed under <body>: never wider than its box (no page scroll) */
body > .select2-container { width: auto !important; max-width: calc(100vw - 16px); }
body > .select2-container .select2-dropdown { max-width: calc(100vw - 16px); }
body { overflow-x: clip; }

/* cards */
.card, .mc-sec, .mc-sum, .mc-stat, .mc-kpi, .mc-report-card, .mc-quick-actions a, .mc-lv__card, .mc-savebar, .mc-doc2__bar { border-radius: 14px; border-color: var(--line); box-shadow: none; }
.card-header { padding: 16px 20px; }
.card-header .card-title, .card-header h4, .card-header h5 { font-size: 16px; }
.card-body { padding: 20px; }
.mc-sec__no { background: var(--brand); box-shadow: 0 4px 10px rgba(50, 189, 234, .35); }
.mc-fcard__head > i, .mc-page-head__ico, .mc-sum__head i { color: var(--brand-600); }
.mc-page-head h1, .mc-page-head h4 { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.mc-savebar, .mc-doc2__bar { box-shadow: 0 -8px 24px rgba(15, 61, 79, .08); }

/* KPI / stat tiles: label, big value, icon in the corner (AutoDeal dashboard) */
.mc-stat, .mc-kpi { position: relative; display: block; padding: 16px; }
.mc-stat__ico, .mc-kpi__ico { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
.mc-stat__label, .mc-kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-right: 44px; }
.mc-stat__value, .mc-kpi__value { font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.mc-kpi__body { display: block; }
a.mc-kpi:hover { border-color: var(--brand); box-shadow: var(--sh-2); transform: none; }

/* ONE table design for every list / report / grid */
.table, .mc-lv__table, table.dataTable, #mcRptTable { font-size: 13.5px; }
.table thead th, .table thead td, .mc-lv__table th, table.dataTable thead th, #tblProducts thead th, .table tr.ligth th {
    background: var(--soft) !important; color: var(--muted) !important; font-size: 11.5px !important; font-weight: 700 !important; text-transform: uppercase;
    letter-spacing: .05em; border: 0 !important; border-bottom: 1px solid var(--line) !important; padding: 11px 14px !important; white-space: nowrap; vertical-align: middle; }
.table td, .mc-lv__table td, table.dataTable tbody td { padding: 12px 14px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; vertical-align: middle; color: var(--text); background: var(--card); }
.table tbody tr:last-child td, .mc-lv__table tbody tr:last-child td { border-bottom: 0 !important; }
.table tbody tr:hover td, .mc-lv__table tbody tr:hover td { background: #f7fcfe; }
.table-bordered, .table-bordered td, .table-bordered th { border-left: 0 !important; border-right: 0 !important; }
.table tfoot td, .table tfoot th { background: var(--soft) !important; border-top: 1px solid var(--line) !important; font-weight: 800; color: var(--ink); padding: 12px 14px !important; }
.mc-grid, .table-responsive:has(> table.table), .table-responsive:has(> .dataTables_wrapper), .dataTables_wrapper {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dataTables_wrapper .table-responsive, .table-responsive .dataTables_wrapper { border: 0; border-radius: 0; }
.mc-items-wrap { border-radius: 14px; }
.mc-items-wrap .table td { padding: 9px 12px !important; }
/* DataTables (reports / admin): search on top, then table, then "Showing" + pages */
.dataTables_wrapper .row { margin: 0; }
.dataTables_wrapper .row > [class*=col] { padding: 0; }
div.dataTables_wrapper div.dataTables_filter { float: none; text-align: left; padding: 14px; border-bottom: 1px solid var(--line); margin: 0; }
div.dataTables_wrapper div.dataTables_filter label { font-size: 0; display: block; width: 100%; max-width: 460px; margin: 0; }
div.dataTables_wrapper div.dataTables_filter input { width: 100% !important; height: 42px !important; border-radius: 10px !important; border: 1px solid var(--input) !important; margin: 0 !important;
    font-size: 14px !important; padding: 0 12px 0 38px !important; background-position: 12px center !important; }
div.dataTables_wrapper div.dataTables_info { padding: 14px !important; color: var(--muted); font-size: 13px; }
div.dataTables_wrapper div.dataTables_paginate { padding: 10px 14px !important; margin: 0 !important; }
div.dataTables_wrapper div.dataTables_paginate ul.pagination { margin: 0; justify-content: flex-end; gap: 4px; }
.page-item .page-link { min-width: 32px; height: 32px; border-radius: 8px !important; border: 1px solid var(--line); color: var(--ink); font-weight: 700; padding: 0 9px; line-height: 30px; margin: 0; }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.dataTables_scrollHeadInner, .dataTables_scrollHeadInner table { width: 100% !important; }
table.dataTable thead input, table.dataTable thead select { display: none !important; }   /* old per-column filter boxes */
.dataTables_empty { padding: 30px !important; color: var(--muted); text-align: center; }

/* row action icons in the older grids */
.list-action { display: inline-flex !important; align-items: center; gap: 6px; flex-wrap: nowrap; }
.list-action .badge { width: 32px; height: 32px; padding: 0 !important; margin: 0 !important; border-radius: 8px !important; display: inline-grid !important; place-items: center;
    font-size: 15px !important; border: 1px solid var(--line); background: var(--card) !important; color: var(--ink) !important; }
.list-action .badge.bg-success { background: var(--brand-50) !important; border-color: var(--brand-100); color: var(--brand-600) !important; }
.list-action .badge.bg-warning, .list-action .badge.bg-danger { background: var(--card) !important; border-color: #f5c9c9; color: var(--red) !important; }

/* list screens */
.mc-lv__card { border: 1px solid var(--line); }
.mc-lv__search input { height: 42px; border-color: var(--input); }
.mc-act { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.mc-act--primary { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.mc-act--danger { color: var(--red); border-color: #f5c9c9; }
.mc-act--danger:hover { background: var(--red-50); }
.mc-docno { color: var(--brand-600) !important; }
.mc-fchip { font-weight: 700; padding: 7px 14px; font-size: 13px; border-color: var(--line); color: var(--ink); }
.mc-fchip.is-on, .mc-tabs .active { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-fchip.is-on small { background: rgba(255, 255, 255, .25); }
.mc-pager button { font-weight: 700; color: var(--ink); border-color: var(--line); }
.mc-pager button.is-on { background: var(--brand); border-color: var(--brand); }

/* badges / chips: pills with a dot */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.mc-chip { border-radius: 20px; font-weight: 700; padding: 2px 10px; }
.mc-chip { background: var(--brand-50); color: var(--brand-600); }
.mc-sum__total { background: var(--navy) !important; }

/* top bar + menu */
.mc-top { background: var(--card); box-shadow: 0 16px 15px 0 rgba(0, 0, 0, .04); border-bottom: 1px solid var(--line); }
.mc-hdr-btn, .mc-top__menu, .mc-fy-chip { border-radius: 12px; border-color: var(--line); }
.mc-top__menu { font-weight: 700; }
.mc-new-btn { border-radius: 12px; box-shadow: 0 6px 14px rgba(50, 189, 234, .35) !important; }
.mc-user__avatar { background: var(--navy); border-radius: 12px; }
.mc-search__input { border-color: var(--line); background: var(--soft); border-radius: 12px; }
.mc-nav-item { font-size: 15px; color: #676e8a !important; padding: 11px 12px; font-weight: 500; }
.mc-nav-item i { color: #676e8a; }
.mc-nav-item:hover { color: #01041b !important; background: var(--soft); }
.mc-nav-item:hover i { color: var(--accent); }
.mc-nav-item.active { background: var(--brand); color: #fff !important; font-weight: 700; box-shadow: 0 6px 14px rgba(50, 189, 234, .3); }
.mc-nav-item.active i { color: #fff; }
.mc-nav-group__title { color: var(--muted); }
.mc-drawer__search input { border: 1px solid var(--line); background: var(--soft); height: 42px; }
.dropdown-item { font-weight: 700; font-size: 13px; color: var(--ink); }
.dropdown-item i { color: var(--brand-600); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--brand-50); color: var(--ink); }

/* toasts and confirm box come from geo-ui.css (same as AutoDeal) */
.mc-toasts { display: none !important; }
.geo-toast-stack { top: calc(var(--top-h) + 12px); }
@media (max-width: 480px) { .geo-toast-stack { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); } }
@media (max-width: 767px) {
    .mc-stat, .mc-kpi { padding: 12px; }
    .mc-stat__value, .mc-kpi__value { font-size: 18px; }
    .mc-stat__ico, .mc-kpi__ico { width: 28px; height: 28px; font-size: 15px; right: 10px; top: 10px; }
    .mc-stat__label, .mc-kpi__label { margin-right: 32px; }
}

/* DataTables sort arrows: small, in their own space at the right of the head cell (never over the text) */
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc,
table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled { position: relative; padding-right: 30px !important; cursor: pointer; }
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after,
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after,
table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after,
table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after {
    position: absolute; top: 50%; bottom: auto !important; display: block; font-size: 11px; line-height: 1; opacity: .3; color: var(--muted); }
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before,
table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before { content: "\2191"; right: 15px !important; transform: translateY(-50%); }
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after { content: "\2193"; right: 8px !important; transform: translateY(-50%); }
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after { opacity: 1; color: var(--brand-600); }
table.dataTable thead > tr > th.num, table.dataTable thead > tr > th.text-right { text-align: right; }
.dataTables_scrollBody table.dataTable thead > tr > th:before, .dataTables_scrollBody table.dataTable thead > tr > th:after { display: none !important; }

/* =====================================================================
   Update 5 - white page background (AutoDeal dashboard look), dashboard period chips,
   small action cards, mini tiles, customer form, opening stock, invoice type form
   ===================================================================== */
:root { --bg: #ffffff; --mc-bg: #ffffff; }
body, .mc-main, .mc-public__main { background: var(--card); }
.card, .mc-sec, .mc-sum, .mc-lv__card, .mc-fcard, .mc-report-card { border: 1px solid var(--line); box-shadow: none; }
.mc-page-head { border-bottom: 0; }

/* ---------- dashboard head: greeting left, period chips right ---------- */
.mc-dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.mc-dash-head h1 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -.01em; }
.mc-dash-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.mc-dash-head__period { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.mc-chip2 { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--card); color: var(--ink) !important; border-radius: 20px; padding: 7px 16px;
    font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none !important; cursor: pointer; font-family: inherit; }
.mc-chip2:hover { border-color: var(--brand); }
.mc-chip2.active { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.mc-dash-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mc-dash-range[hidden] { display: none; }
.mc-dash-range .form-control { width: 160px; height: 40px; }
.mc-dash-range .btn { height: 40px; }
.mc-dash-range span { color: var(--muted); font-weight: 600; }
.mc-dash-head__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.mc-dash-head__meta small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mc-dash-fy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 0 2px 0 10px; background: var(--card); }
.mc-dash-fy label { margin: 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.mc-dash-fy select.form-control { border: 0 !important; box-shadow: none !important; height: 32px !important; min-height: 32px; padding: 0 26px 0 4px; font-size: 13px; font-weight: 700; width: auto; min-width: 110px; background-color: transparent; }

/* ---------- small action cards (same 4 columns as the number cards below) ---------- */
.mc-actions, .mc-kpis.mc-kpis--4, .mc-minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mc-actions { margin-bottom: 12px; }
.mc-action { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px;
    color: var(--ink) !important; text-decoration: none !important; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.mc-action:hover { border-color: var(--brand); box-shadow: 0 6px 16px rgba(15,61,79,.07); }
.mc-action__ico { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-600); font-size: 18px; flex: none; }
.mc-action--primary { background: var(--brand); border-color: var(--brand); color: #fff !important; box-shadow: 0 6px 16px rgba(50,189,234,.28); }
.mc-action--primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.mc-action--primary .mc-action__ico { background: rgba(255,255,255,.22); color: #fff; }
.mc-action--green .mc-action__ico { background: var(--green-50); color: var(--green); }
.mc-action--amber .mc-action__ico { background: var(--amber-50); color: var(--amber); }
.mc-action--teal .mc-action__ico { background: var(--teal-50); color: var(--teal); }
.mc-action--violet .mc-action__ico { background: var(--violet-50); color: var(--violet); }
.mc-action--red .mc-action__ico { background: var(--red-50); color: var(--red); }

.mc-kpis.mc-kpis--4 { margin-bottom: 12px; }
.mc-kpis--4 .mc-kpi { padding: 14px 16px; }
.mc-kpis--4 .mc-kpi__value { font-size: 26px; }

.mc-minis { margin-bottom: 18px; }
.mc-mini { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: inherit !important; text-decoration: none !important; min-width: 0; }
.mc-mini:hover { border-color: var(--brand); }
.mc-mini > i { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--brand-50); color: var(--brand-600); flex: none; }
.mc-mini--violet > i { background: var(--violet-50); color: var(--violet); }
.mc-mini--amber > i { background: var(--amber-50); color: var(--amber); }
.mc-mini--green > i { background: var(--green-50); color: var(--green); }
.mc-mini span { min-width: 0; line-height: 1.25; }
.mc-mini small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-mini b { display: block; font-size: 15.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

@media (max-width: 1199.98px) {
    .mc-kpis.mc-kpis--4, .mc-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .mc-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mc-dash-head__period { align-items: stretch; width: 100%; }
    .mc-chips, .mc-dash-head__meta, .mc-dash-range { justify-content: flex-start; }
}
@media (max-width: 575.98px) {
    .mc-dash-head h1 { font-size: 19px; }
    .mc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; }
    .mc-chips::-webkit-scrollbar { display: none; }
    .mc-chip2 { white-space: nowrap; padding: 6px 13px; }
    .mc-actions, .mc-kpis.mc-kpis--4, .mc-minis { gap: 8px; }
    .mc-action { padding: 8px 10px; font-size: 13px; gap: 8px; }
    .mc-action__ico { width: 30px; height: 30px; font-size: 16px; }
    .mc-kpis--4 .mc-kpi { padding: 12px; }
    .mc-kpis--4 .mc-kpi__value { font-size: 19px; }
    .mc-dash-range .form-control { width: calc(50% - 22px); }
    .mc-dash-range .btn { width: 100%; }
}
@media print { .mc-actions, .mc-dash-head__period { display: none !important; } }

/* ---------- segmented choice (radio buttons) + on / off switch (check boxes) ---------- */
.mc-seg { display: inline-flex; flex-wrap: wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; max-width: 100%; }
.mc-seg input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mc-seg label { margin: 0; padding: 8px 18px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; line-height: 1.3; transition: background .15s, color .15s; user-select: none; }
.mc-seg label:hover { color: var(--ink); }
.mc-seg input:checked + label { background: var(--card); color: var(--brand-600); box-shadow: 0 1px 4px rgba(15,61,79,.14); }
.mc-seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }
.mc-seg input:disabled + label { opacity: .6; cursor: not-allowed; }
.mc-seg--lg label { padding: 10px 28px; font-size: 14.5px; }

.mc-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.mc-switch input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 40px; height: 22px; border-radius: 22px; background: #cfdde3; position: relative; cursor: pointer; margin: 0;
    flex: none; transition: background .15s; outline: 0; vertical-align: middle; }
.mc-switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.mc-switch input[type=checkbox]:checked { background: var(--brand); }
.mc-switch input[type=checkbox]:checked::after { transform: translateX(18px); }
.mc-switch input[type=checkbox]:focus-visible { box-shadow: 0 0 0 3px rgba(50,189,234,.28); }
.mc-switch input[type=checkbox]:disabled { opacity: .55; cursor: not-allowed; }
.mc-switch label { margin: 0; font-weight: 600; color: var(--ink); cursor: pointer; font-size: 14px; }
.mc-switch-row { justify-content: flex-start; padding: 11px 14px; }
.mc-savebar .mc-switch-row { border: 0; padding: 0; margin: 0; background: none; display: inline-flex; }

.mc-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.mc-hint i { color: var(--brand-600); }
.mc-hint a { color: var(--brand-600); font-weight: 600; }
.mc-inline-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-bottom: 12px; }

/* ---------- read-only fields (Edit Invoice Details) ---------- */
.form-control.mc-ro, .form-control.mc-ro[readonly] { background: var(--soft) !important; color: var(--ink); font-weight: 700; cursor: not-allowed; border-style: dashed; }
.form-control.mc-ro:focus { box-shadow: none; border-color: var(--input); }
.mc-lock-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }
.mc-sec__head .mc-lock-pill { margin-left: 8px; }

/* ---------- add / edit party ---------- */
.mc-pf { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mc-pf__aside { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.mc-pf-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mc-pf-card__top { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(180deg, var(--brand-50), #fff); border-bottom: 1px solid var(--line-2); }
.mc-pf-card__top b { display: block; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.mc-pf-card__top .min-w-0 { min-width: 0; }
.mc-pf-card__av { width: 46px; height: 46px; border-radius: 14px; background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mc-pf-card__rows { list-style: none; margin: 0; padding: 6px 16px; }
.mc-pf-card__rows li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.mc-pf-card__rows li:last-child { border-bottom: 0; }
.mc-pf-card__rows i { color: var(--brand-600); font-size: 16px; line-height: 1.4; }
.mc-pf-card__rows span { min-width: 0; }
.mc-pf-card__rows small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mc-pf-card__rows b { display: block; font-size: 13.5px; color: var(--ink); word-break: break-word; }
.mc-pf-card__tax { margin: 0 16px 14px; padding: 8px 10px; border-radius: 10px; background: var(--green-50); color: var(--green); font-size: 12.5px; }
.mc-pf-card__tax[hidden] { display: none; }
.mc-pf-tips { border: 1px dashed var(--input); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; color: var(--text); }
.mc-pf-tips b { color: var(--ink); }
.mc-pf-tips b i { color: var(--amber); }
.mc-pf-tips ul { margin: 6px 0 0; padding-left: 18px; }
.mc-pf-tips li { margin-bottom: 3px; }
.mc-pin-suggest { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--ink); }
.mc-pin-suggest .mc-chip2 { padding: 4px 12px; font-size: 12.5px; }
.mc-pf .autocomplete-suggestions { left: 8px; right: 8px; width: auto !important; top: 74px; border-color: var(--line) !important; border-radius: 10px !important; }
@media (max-width: 991.98px) {
    .mc-pf { grid-template-columns: 1fr; }
    .mc-pf__aside { position: static; order: -1; }
    .mc-pf-tips, .mc-pf-card__rows { display: none; }
}
@media (max-width: 575.98px) {
    .mc-seg { display: flex; }
    .mc-seg label { flex: 1 1 0; text-align: center; padding: 9px 8px; }
}

/* ---------- opening stock list ---------- */
.mc-grid-body { padding: 12px 18px 18px !important; }
.mc-grid-body .table td, .mc-grid-body .table th { white-space: nowrap; }
.mc-grid-body .mc-acts { display: inline-flex; gap: 6px; }
.mc-grid-body td.mc-act-cell, .mc-grid-body th.mc-act-cell { text-align: right; width: 1%; }
.mc-grid-body .dataTables_filter input { height: 40px; border-radius: 10px; }
.mc-pf-card .mc-chip--orange { background: var(--accent-50) !important; color: #c2410c !important; }
.mc-pf-card .mc-chip--green { background: var(--green-50) !important; color: var(--green) !important; }
.select > label { margin-bottom: .5rem; display: inline-block; line-height: 1.5; }

/* =====================================================================
   Update 6 - new features: attention strip, list selection, pop-up forms,
   settings / UPI card, reminders, slabs, godowns, low stock, GST returns, backup
   ===================================================================== */

/* ---------- dashboard: needs attention ---------- */
.mc-attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mc-attn__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid #f3dca8; background: var(--amber-50); color: var(--ink) !important; text-decoration: none !important; }
.mc-attn__item > i:first-child { width: 34px; height: 34px; border-radius: 10px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--amber); flex: none; }
.mc-attn__item > i:last-child { margin-left: auto; color: var(--muted); font-size: 20px; }
.mc-attn__item span { min-width: 0; line-height: 1.25; }
.mc-attn__item b { display: block; font-size: 14px; }
.mc-attn__item small { color: var(--muted); font-size: 12px; }
.mc-attn__item:hover { box-shadow: 0 6px 16px rgba(15,61,79,.08); }
.mc-attn__item--violet { background: var(--violet-50); border-color: #ddd8f7; } .mc-attn__item--violet > i:first-child { color: var(--violet); }
.mc-attn__item--red { background: var(--red-50); border-color: #f5c9c9; } .mc-attn__item--red > i:first-child { color: var(--red); }
.mc-attn__item:not([class*="--"]) { background: var(--brand-50); border-color: #c9ecf8; } .mc-attn__item:not([class*="--"]) > i:first-child { color: var(--brand-600); }

/* ---------- list: select rows + bulk bar ---------- */
.mc-sel-cell { width: 1%; padding-right: 0 !important; }
.mc-sel-cell input, .mc-card-sel { width: 18px; height: 18px; vertical-align: middle; }
.mc-lv__table tr.is-sel td { background: #f0fafe !important; }
.mc-card-row.is-sel { border-color: var(--brand); background: #f6fcfe; }
.mc-lv__bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid #c9ecf8; position: sticky; top: var(--top-h); z-index: 3; }
.mc-lv__bulk[hidden] { display: none; }
.mc-lv__bulk b { margin-right: 6px; color: var(--ink); }
.mc-lv__bulk .btn { height: 34px; }

/* ---------- pop-up forms ---------- */
.mc-fmodal .modal-content { border-radius: 16px; border: 0; }
.mc-fmodal .modal-header { border-bottom: 1px solid var(--line-2); padding: 14px 18px; }
.mc-fmodal .modal-title { font-weight: 800; font-size: 16px; color: var(--ink); }
.mc-fmodal .modal-title i { color: var(--brand-600); margin-right: 4px; }
.mc-fmodal .modal-body { padding: 16px 18px; }
.mc-fmodal .modal-footer { border-top: 1px solid var(--line-2); padding: 12px 18px; }
.mc-fmodal .mc-switch { margin-top: 6px; }
.mc-fmodal .mc-switch span { font-weight: 600; color: var(--ink); }

/* ---------- settings + UPI card ---------- */
.mc-set-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.mc-set-aside { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.mc-pay-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.mc-pay-card__head { font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.mc-pay-card__head i { color: var(--green); }
.mc-pay-card__qr { width: 200px; height: 200px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--input); border-radius: 12px; padding: 8px; }
.mc-pay-card__qr svg { width: 100%; height: 100%; }
.mc-pay-card__id { font-weight: 800; color: var(--ink); margin-bottom: 6px; word-break: break-all; }
.mc-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mc-perms > span, .mc-perms > label { margin: 0; }
.mc-perms input { display: none; }
.mc-perms label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 700; color: var(--ink); margin: 0; }
.mc-perms label::before { content: ""; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--input); flex: none; background: var(--card); }
.mc-perms input:checked + label { border-color: var(--brand); background: var(--brand-50); }
.mc-perms input:checked + label::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 15.17l9.19-9.19 1.42 1.42L10 18 3.39 11.39l1.42-1.42z'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--brand); }
.mc-input-btn { display: flex; gap: 8px; }
.mc-input-btn .form-control { flex: 1 1 auto; min-width: 0; }
.mc-input-btn .btn { height: 44px; white-space: nowrap; }
@media (max-width: 991.98px) { .mc-set-grid { grid-template-columns: 1fr; } .mc-set-aside { position: static; } }

/* ---------- backup ---------- */
.mc-backup .card-body { text-align: center; padding: 34px 20px !important; }
.mc-backup__ico { width: 72px; height: 72px; border-radius: 20px; background: var(--brand-50); color: var(--brand-600); font-size: 36px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.mc-backup h3 { font-weight: 800; color: var(--ink); }
.mc-backup p { max-width: 620px; margin: 0 auto 12px; }
.mc-backup__last { color: var(--muted); }
.mc-backup__tips { list-style: none; padding: 0; margin: 20px auto 0; max-width: 460px; text-align: left; }
.mc-backup__tips li { padding: 4px 0; } .mc-backup__tips i { color: var(--green); margin-right: 6px; }

/* ---------- reminders ---------- */
.mc-rem__row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(0, 2fr) 120px auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mc-rem__row:last-child { border-bottom: 0; }
.mc-rem__row.is-due { background: #fffbf2; }
.mc-rem__info { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.mc-rem__info b { color: var(--text); font-weight: 700; }
.mc-rem__amt { font-weight: 800; color: var(--red); text-align: right; font-variant-numeric: tabular-nums; }
.mc-rem__acts { display: flex; gap: 6px; justify-content: flex-end; }
.mc-rem-bar { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 14px 40px rgba(15,61,79,.18); padding: 10px 12px; display: flex; gap: 8px; align-items: center; z-index: 1040; max-width: calc(100vw - 16px); }
.mc-rem-bar[hidden] { display: none; }
.mc-rem-bar span { min-width: 0; margin-right: 6px; line-height: 1.2; }
.mc-rem-bar small { display: block; color: var(--muted); font-size: 11.5px; }
.mc-rem-bar b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 46vw; }
@media (min-width: 992px) { .mc-rem-bar { bottom: 24px; } }
@media (max-width: 767.98px) {
    .mc-rem__row { grid-template-columns: 1fr auto; }
    .mc-rem__info { grid-column: 1 / -1; order: 3; }
    .mc-rem__acts { grid-column: 1 / -1; order: 4; justify-content: flex-start; }
}
.mc-lv__bar .mc-chips { justify-content: flex-start; }

/* ---------- slabs ---------- */
.mc-slab-tools { display: grid; grid-template-columns: 1.2fr .8fr repeat(3, 1fr) .7fr auto; gap: 8px; align-items: end; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.mc-slab-tools .form-group { margin: 0; }
.mc-slab-tools label { font-size: 12px; }
.mc-slab-tools .btn { height: 44px; white-space: nowrap; }
.mc-slab-table td, .mc-slab-table th { padding: 6px 8px !important; vertical-align: middle !important; }
.mc-slab-table .form-control { height: 38px !important; min-height: 38px; padding: 4px 8px; }
.mc-slab-table td:nth-child(2) .form-control { min-width: 120px; }
.mc-slab-table td:nth-child(n+3):nth-child(-n+6) .form-control { min-width: 80px; }
.mc-sqft { height: 44px; display: flex; align-items: center; font-size: 20px; font-weight: 800; color: var(--ink); }
@media (max-width: 991.98px) { .mc-slab-tools { grid-template-columns: 1fr 1fr 1fr; } .mc-slab-tools .form-group:last-child { grid-column: 1 / -1; } .mc-slab-tools .btn { width: 100%; } }

/* ---------- godowns ---------- */
.mc-godowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mc-godowns > .mc-empty { grid-column: 1 / -1; background: var(--card); border: 1px dashed var(--input); border-radius: 14px; }
.mc-godown { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mc-godown.is-off { opacity: .7; }
.mc-godown__top { display: flex; gap: 10px; align-items: flex-start; }
.mc-godown__top b { color: var(--ink); font-size: 15px; }
.mc-godown__top small { display: block; color: var(--muted); }
.mc-godown__ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.mc-godown__nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-godown__nums span { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.mc-godown__nums small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.mc-godown__nums b { font-size: 18px; color: var(--ink); }
.mc-godown__acts { display: flex; gap: 6px; }
.min-w-0 { min-width: 0; }

/* ---------- low stock ---------- */
tr.mc-row-warn td { background: #fff8f1 !important; }
.mc-table .form-control-sm { height: 36px !important; min-height: 36px; }

/* ---------- GST returns ---------- */
.mc-gst-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mc-gst-filter .form-group { margin-bottom: 10px; }
.mc-gst-filter .form-control { min-width: 160px; }
.mc-gst-filter .btn { height: 44px; }
.mc-gst-filter__chk { padding-bottom: 10px; }
.mc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 6px 0 12px; }
.mc-tabs::-webkit-scrollbar { display: none; }
.mc-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-family: inherit; cursor: pointer; }
.mc-tabs button.active { color: var(--brand-600); border-bottom-color: var(--brand); }
.mc-tabs button span { background: var(--soft); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.mc-tabs button span:empty { display: none; }
.mc-gst-body .mc-empty { padding: 30px 10px; }
.mc-sec-mini { padding: 12px 16px 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mc-steps { padding-left: 20px; margin: 0; }
.mc-steps li { margin-bottom: 6px; }
.mc-switch input + span { font-weight: 600; color: var(--ink); }
.mc-table .mc-sub, .mc-gst-body .mc-sub, .mc-rem .mc-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.mc-tabs button.active, .mc-tabs button:hover, .mc-tabs button:focus { background: none !important; box-shadow: none !important; outline: 0; }
.mc-tabs button.active { color: var(--brand-600) !important; border-bottom-color: var(--brand) !important; }
.mc-tabs button span { display: inline-block; width: auto !important; height: auto !important; line-height: 1.5; color: var(--muted); }

/* ---------- search boxes: one clear (x) button everywhere ---------- */
/* list search: our own round clear button inside the box (the icon was positioned like the search icon before) */
.mc-lv__search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.mc-lv__search .mc-lv__clear { right: 8px; width: 26px; height: 26px; padding: 0; display: none; align-items: center; justify-content: center; border-radius: 50%; line-height: 1; z-index: 1; }
.mc-lv__search.has-value .mc-lv__clear { display: inline-flex; }
.mc-lv__search .mc-lv__clear i { position: static !important; transform: none !important; left: auto !important; top: auto !important; font-size: 18px; color: var(--muted); pointer-events: none; }
.mc-lv__search .mc-lv__clear:hover i { color: var(--ink); }
.mc-lv__search input::-webkit-search-cancel-button, .mc-lv__search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.mc-lv__search input::-ms-clear { display: none; }
/* every other search box: the browser's clear button, drawn in the same style */
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-left: 6px; cursor: pointer; border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b8490'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-11.414L9.172 7.757 7.757 9.172 10.586 12l-2.829 2.828 1.415 1.415L12 13.414l2.828 2.829 1.415-1.415L13.414 12l2.829-2.828-1.415-1.415L12 10.586z'/%3E%3C/svg%3E") center / 18px no-repeat; }
input[type=search]::-webkit-search-cancel-button:hover { filter: brightness(.6); }
.mc-search__input::-webkit-search-cancel-button { display: none; }

/* =====================================================================================
   Update 10 - Molding design (Invoice/MoldingDesign.aspx + drawing editor)
   ===================================================================================== */
.mc-md { max-width: 980px; margin: 0 auto; }
.mc-md-items { display: flex; flex-direction: column; gap: 12px; }
.mc-md-item { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.mc-md-item.is-plain { background: var(--soft); }
.mc-md-item.is-mold { border-left: 4px solid var(--amber); }
.mc-md-item.is-done { border-left-color: var(--green); }
.mc-md-item__no { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.mc-md-item.is-plain .mc-md-item__no { background: #eef3f5; color: var(--muted); }
.mc-md-item__body { flex: 1; min-width: 0; }
.mc-md-item__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mc-md-item__name { font-weight: 800; color: var(--ink); font-size: 15px; }
.mc-md-item__meta { color: var(--muted); font-size: 13px; }
.mc-md-mold { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.mc-md-mold__name { color: var(--text); margin-bottom: 10px; }
.mc-md-mold__name i { color: var(--brand-600); }
.mc-md-mold__name b { color: var(--ink); }
.mc-md-draw { min-height: 46px; padding: 0 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.mc-md-thumb { display: block; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; max-width: 420px; width: 100%; cursor: zoom-in; }
.mc-md-thumb img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; }
.mc-md-thumb:hover { border-color: var(--brand); }
.mc-md-note { margin-top: 8px; color: var(--text); font-size: 13px; }
.mc-md-note i { color: var(--amber); }
.mc-md-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.mc-md-acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.mc-md-acts small { color: var(--muted); }
.mc-md-sand { margin-top: 8px; color: var(--muted); font-size: 13px; }
.mc-md-banner { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.mc-md-banner > i { font-size: 26px; color: var(--brand-600); }
.mc-md-banner > div { flex: 1; min-width: 0; }
.mc-md-banner b { display: block; color: var(--ink); }
.mc-md-banner span { color: var(--muted); font-size: 13px; }
.mc-md-banner.is-ok { background: var(--green-50); border-color: #cdeedd; }
.mc-md-banner.is-ok > i { color: var(--green); }
.mc-md-banner .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mc-md-bar { height: 8px; border-radius: 8px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.mc-md-bar i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }
.mc-md-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 40px 20px; text-align: center; }
.mc-md-empty i { font-size: 40px; color: var(--faint); }
.mc-md-empty h3 { font-size: 17px; margin: 8px 0 16px; }

/* ---------------------------------------------------------------- editor (full screen) */
html.mc-mde-open, html.mc-mde-open body { overflow: hidden; }
.mc-mde { position: fixed; inset: 0; z-index: 100005; background: #eef3f5; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.mc-mde__top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.mc-mde__title { flex: 1; min-width: 0; line-height: 1.25; }
.mc-mde__title b { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-mde__title small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-mde__ib { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 20px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mc-mde__ib:disabled { opacity: .35; cursor: default; }
.mc-mde__save { height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 18px; font-weight: 700; }
.mc-mde__tools { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.mc-mde__tool { flex: none; min-width: 58px; height: 52px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.mc-mde__tool i { font-size: 20px; line-height: 1; }
.mc-mde__tool:hover { background: var(--soft); }
.mc-mde__tool.is-on { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.mc-mde__sep { flex: none; width: 1px; height: 32px; background: var(--line); margin: 0 6px; }
.mc-mde__color { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; margin: 0 2px; }
.mc-mde__color.is-on { box-shadow: 0 0 0 2px var(--brand); }
.mc-mde__w { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mc-mde__w i { display: block; width: 22px; border-radius: 4px; background: var(--ink); }
.mc-mde__w.is-on { background: var(--brand-50); border-color: var(--brand-200); }
.mc-mde__stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; gap: 6px; }
.mc-mde__paper { width: 100%; max-width: calc((100vh - 230px) * 1.5); aspect-ratio: 3 / 2; background: var(--card); border-radius: 12px; box-shadow: 0 6px 24px rgba(15, 61, 79, .12); overflow: hidden; }
.mc-mde__paper canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.mc-mde__hint { color: var(--muted); font-size: 12.5px; text-align: center; min-height: 18px; }
.mc-mde__foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border-top: 1px solid var(--line); }
.mc-mde__foot i { color: var(--amber); font-size: 20px; }
.mc-mde__foot .form-control { height: 42px; }
.mc-mde__tpl, .mc-mde__ask { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 2; }
.mc-mde__tpl[hidden], .mc-mde__ask[hidden], .mc-mde__busy[hidden] { display: none; }
.mc-mde__tplbox { background: var(--card); border-radius: 16px; width: 100%; max-width: 760px; max-height: 90%; overflow: auto; padding: 16px; }
.mc-mde__tplhead { display: flex; align-items: center; justify-content: space-between; }
.mc-mde__tplhead b { color: var(--ink); font-size: 16px; }
.mc-mde__tplbox p { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.mc-mde__tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mc-mde__tplitem { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--ink); font-size: 13px; }
.mc-mde__tplitem canvas { width: 100%; height: auto; border-radius: 8px; }
.mc-mde__tplitem:hover { border-color: var(--brand); background: var(--brand-50); }
.mc-mde__askbox { background: var(--card); border-radius: 16px; width: 100%; max-width: 380px; padding: 16px; }
.mc-mde__askbox label { font-weight: 700; color: var(--ink); display: block; margin-bottom: 8px; }
.mc-mde__askbox .form-control { height: 46px; font-size: 16px; }
.mc-mde__askbtn { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.mc-mde__busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #1e293b; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
    .mc-md-item { padding: 12px; gap: 10px; }
    .mc-md-item__head { flex-direction: column; }
    .mc-md-draw { width: 100%; justify-content: center; }
    .mc-md-thumb { max-width: none; }
    .mc-md-banner { flex-wrap: wrap; }
    .mc-mde__save span { display: none; }
    .mc-mde__save { padding: 0 14px; }
    .mc-mde__ib { width: 40px; height: 40px; }
    .mc-mde__stage { padding: 8px; }
    .mc-mde__paper { max-width: none; border-radius: 8px; }
    .mc-mde__tool { min-width: 52px; }
}
@media (max-width: 640px) and (orientation: portrait) {
    .mc-mde__stage { order: 2; justify-content: flex-start; padding-top: 12px; }
    .mc-mde__tools { order: 3; border-bottom: 0; border-top: 1px solid var(--line); }
    .mc-mde__foot { order: 4; border-top: 1px solid var(--line-2); }
    .mc-mde__rot { display: flex !important; }
}
.mc-mde__rot { display: none; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); font-size: 13px; font-weight: 700; max-width: 100%; }
.mc-mde__rot i { font-size: 20px; }
@media (orientation: landscape) and (max-height: 520px) {
    .mc-mde__tool span { display: none; }
    .mc-mde__tool { height: 40px; min-width: 42px; }
    .mc-mde__paper { max-width: calc((100vh - 170px) * 1.5); }
    .mc-mde__hint { display: none; }
}

/* Update 11: summary of the quotation on the molding design page */
.mc-md-sum { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 14px; }
.mc-md-sum h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.mc-md-sum h3 i { color: var(--brand-600); }
.mc-md-sum dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0; }
.mc-md-sum dl div { background: var(--soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.mc-md-sum dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.mc-md-sum dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .mc-md-sum dl { grid-template-columns: 1fr 1fr; } .mc-page-head__actions .btn span { display: none; } }
.mc-btn-wa, .mc-btn-wa:hover, .mc-btn-wa:focus { background: #25D366 !important; border-color: #25D366 !important; color: #fff !important; box-shadow: 0 6px 16px rgba(37, 211, 102, .25); }
.mc-btn-wa:hover { background: #1ebe5b !important; }

/* ---------------------------------------------------------------- Update 18: molding templates */
.mc-md-acts--new { margin-top: 4px; }
.mc-md-miss { background: var(--card); border: 1px solid var(--brand-200); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; }
.mc-md-miss > b { display: flex; align-items: center; gap: 8px; color: var(--ink); margin-bottom: 6px; }
.mc-md-miss > b i { color: var(--brand-600); font-size: 20px; }
.mc-md-miss__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.mc-md-miss__row span { color: var(--ink); font-weight: 700; min-width: 0; }
.mc-md-miss__row small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.mc-md-miss__row .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mc-md-info { display: flex; gap: 10px; align-items: flex-start; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; color: var(--text); font-size: 13px; }
.mc-md-info i { color: var(--brand-600); font-size: 18px; line-height: 1.2; }
.mc-mde__also { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: 13px; color: var(--text); cursor: pointer; }
.mc-mde__also input { width: 18px; height: 18px; }
@media (max-width: 640px) { .mc-mde__foot { flex-wrap: wrap; } .mc-mde__also { white-space: normal; } }

/* "use on other lines" */
.mc-md-pick { position: fixed; inset: 0; z-index: 100010; background: rgba(15,61,79,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mc-md-pick__box { background: var(--card); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.mc-md-pick__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mc-md-pick__head b { color: var(--ink); }
.mc-md-pick__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.mc-md-pick__list { overflow-y: auto; padding: 4px 8px; flex: 1; }
.mc-md-pick__list label { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; margin: 0; cursor: pointer; }
.mc-md-pick__list label:hover { background: var(--soft); }
.mc-md-pick__list input { width: 20px; height: 20px; flex: none; }
.mc-md-pick__list .n { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink); }
.mc-md-pick__list .t { flex: 1; min-width: 0; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.mc-md-pick__list .t small { display: block; color: var(--muted); font-weight: 400; }
.mc-md-pick__foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.mc-md-pick__foot .cnt { flex: 1; color: var(--muted); font-size: 13px; }
.mc-md-pick__foot .btn { display: inline-flex; align-items: center; gap: 6px; }

/* Masters -> Molding Templates */
.mc-tpl-help { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; color: var(--text); font-size: 13.5px; }
.mc-tpl-help i { color: var(--brand-600); font-size: 22px; line-height: 1.1; }
.mc-tpl-help b { color: var(--ink); }
.mc-tpl-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.mc-tpl-bar .form-control { max-width: 340px; height: 44px; }
.mc-tpl-bar span { color: var(--muted); font-size: 13px; }
.mc-tpl-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.mc-tpl-sec h3 { font-size: 16px; color: var(--ink); margin: 0 0 12px; font-weight: 900; }
.mc-tpl-sec h3 small { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.mc-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mc-tpl-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--card); text-align: left; min-width: 0; }
.mc-tpl-card__pic { display: flex; align-items: center; justify-content: center; height: 110px; border-radius: 8px; background: var(--soft); border: 0; padding: 4px; overflow: hidden; cursor: pointer; }
.mc-tpl-card__pic img { max-width: 100%; max-height: 100%; }
.mc-tpl-card__t { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-tpl-card small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-tpl-card__acts { display: flex; gap: 6px; margin-top: 4px; }
.mc-tpl-card__acts .btn { display: inline-flex; align-items: center; gap: 4px; }
.mc-tpl-card.is-empty { border-style: dashed; cursor: pointer; }
.mc-tpl-card.is-empty .mc-tpl-card__pic { background: var(--card); border: 1px dashed var(--line); font-size: 28px; color: var(--brand-600); }
.mc-tpl-card.is-empty:hover { border-color: var(--brand-200); background: var(--brand-50); }
@media (max-width: 640px) { .mc-tpl-grid { grid-template-columns: 1fr 1fr; } .mc-md-miss__row { flex-wrap: wrap; } }

/* Quotation screen: template preview */
.mc-tpl-prev__in { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--soft); }
.mc-tpl-prev__in img { width: 110px; height: 64px; object-fit: contain; background: var(--card); border: 1px solid var(--line); border-radius: 8px; flex: none; }
.mc-tpl-prev__in b { display: block; color: var(--ink); font-size: 13.5px; }
.mc-tpl-prev__in small { display: block; color: var(--muted); font-size: 12px; }
.mc-tpl-prev__in.is-none { border-style: dashed; background: var(--card); }
.mc-tpl-prev__in.is-none > i { font-size: 26px; color: var(--amber); }

/* =====================================================================================
   Update 13 - Job Cards, Delivery Challans, Rate Lists, Daily Summary, rate hint, language switch
   ===================================================================================== */
.mc-md--wide { max-width: 1180px; }

/* stage tabs */
.mc-jb-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.mc-jb-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer; }
.mc-jb-tab b { background: var(--line-2); color: var(--ink); border-radius: 20px; padding: 1px 8px; font-size: 12px; }
.mc-jb-tab i { font-size: 16px; }
.mc-jb-tab.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-jb-tab.is-on b { background: rgba(255,255,255,.25); color: #fff; }
.mc-jb-tab--amber i { color: var(--amber); } .mc-jb-tab--teal i { color: var(--teal); } .mc-jb-tab--violet i { color: var(--violet); } .mc-jb-tab--green i { color: var(--green); } .mc-jb-tab--grey i { color: var(--muted); }
.mc-jb-tab.is-on i { color: #fff; }
.mc-jb-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mc-jb-bar .mc-lv__search { flex: 1; min-width: 220px; position: relative; }
.mc-jb-bar .mc-lv__search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.mc-jb-bar .mc-lv__search input { padding-left: 36px; height: 42px; }
.mc-jb-bar .btn { height: 42px; display: inline-flex; align-items: center; gap: 6px; }

/* cards */
.mc-jb-list { display: flex; flex-direction: column; gap: 10px; }
.mc-jb-card { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: inherit; text-decoration: none !important; }
a.mc-jb-card:hover { border-color: var(--brand-200); }
.mc-jb-card--amber { border-left-color: var(--amber); } .mc-jb-card--teal { border-left-color: var(--teal); } .mc-jb-card--violet { border-left-color: var(--violet); }
.mc-jb-card--green { border-left-color: var(--green); } .mc-jb-card--grey { border-left-color: #c3d4db; }
.mc-jb-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mc-jb-card__name { font-weight: 800; color: var(--ink); font-size: 15px; }
.mc-jb-card__name small { color: var(--muted); font-weight: 600; }
.mc-jb-card__meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.mc-jb-card__meta b { color: var(--ink); }
.mc-jb-card__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mc-jb-card__acts .btn { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.mc-jb-steps { list-style: none; display: flex; gap: 4px; margin: 12px 0 4px; padding: 0; }
.mc-jb-steps li { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--faint); position: relative; padding-top: 4px; border-top: 4px solid var(--line-2); border-radius: 2px; }
.mc-jb-steps li i { display: block; font-size: 15px; }
.mc-jb-steps li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-jb-steps li.is-done { color: var(--green); border-top-color: var(--green); }
.mc-jb-steps li.is-cur { color: var(--brand-700); border-top-color: var(--brand); font-weight: 800; }
.mc-jb-note { display: flex; gap: 8px; margin-top: 8px; padding: 8px 10px; background: var(--soft); border-radius: 10px; font-size: 13px; }
.mc-jb-note i { color: var(--muted); margin-top: 2px; }
.mc-jb-note.is-appr { background: var(--green-50); } .mc-jb-note.is-appr i { color: var(--green); }
.mc-jb-note small { display: block; color: var(--muted); }
.mc-jb-hist { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.mc-jb-tl { list-style: none; margin: 0; padding: 0; }
.mc-jb-tl li { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; }
.mc-jb-tl li i { color: var(--brand-600); margin-top: 2px; }
.mc-jb-tl small { display: block; color: var(--muted); }
.mc-jb-chl { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.mc-jb-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 30px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mc-jb-empty i { font-size: 34px; color: var(--faint); }
.mc-jb-empty b { color: var(--ink); }

/* challan */
.mc-ch-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--soft); }
.mc-ch-table td small { display: block; color: var(--muted); }
.mc-ch-table tr.is-done td { color: var(--faint); }
.mc-ch-qty { width: 96px; margin-left: auto; text-align: right; }
.mc-ch-save { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 14px 0 30px; }
.mc-ch-save .btn { height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 18px; }
.mc-ch-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.mc-ch-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 12px; }
.mc-ch-dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mc-ch-dl dd { margin: 0; color: var(--ink); }
.mc-sign { position: relative; border: 2px dashed #b6c7ce; border-radius: 12px; overflow: hidden; background: var(--card); }
.mc-sign canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.mc-sign__hint { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: #b6c7ce; pointer-events: none; font-size: 18px; }
.mc-sign__hint[hidden] { display: none; }
.mc-sign__clear { position: absolute; right: 8px; top: 8px; }
.mc-sign-done img { max-width: 100%; max-height: 140px; display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--card); }
.mc-sign-done small { display: block; color: var(--muted); }

/* rate lists */
.mc-rl-cats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mc-rl-cat { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 14px; text-align: left; cursor: pointer; }
.mc-rl-cat b { display: block; color: var(--ink); }
.mc-rl-cat small { color: var(--muted); }
.mc-rl-cat.is-on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand); }
.mc-rl-add { color: var(--brand-700); font-weight: 700; border-style: dashed; }
.mc-rl-catacts { margin-left: auto; display: inline-flex; gap: 6px; }
.mc-rl-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.mc-rl-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; height: 40px; padding: 0 14px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mc-rl-tabs button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mc-rl-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: 70vh; }
.mc-rl-table thead th { position: sticky; top: 0; z-index: 1; }
.mc-rl-in { max-width: 160px; margin-left: auto; text-align: right; }
select.mc-rl-in { text-align: left; max-width: 260px; margin-left: 0; }

/* daily summary */
.mc-ds-date { max-width: 180px; height: 42px; }
.mc-ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mc-ds-tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 12px 52px; color: inherit; text-decoration: none !important; min-height: 84px; }
a.mc-ds-tile:hover { border-color: var(--brand-200); }
.mc-ds-tile i { position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; }
.mc-ds-tile span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.mc-ds-tile b { display: block; color: var(--ink); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mc-ds-tile small { color: var(--muted); }
.mc-ds-tile--green i { background: var(--green-50); color: var(--green); } .mc-ds-tile--amber i { background: var(--amber-50); color: var(--amber); }
.mc-ds-tile--red i { background: var(--red-50); color: var(--red); } .mc-ds-tile--violet i { background: var(--violet-50); color: var(--violet); }
.mc-ds-tile--orange i { background: var(--accent-50); color: var(--accent); }
.mc-ds-text { white-space: pre-wrap; font-family: inherit; font-size: 14px; color: var(--text); background: var(--soft); border-radius: 10px; padding: 12px; margin: 0; }

/* rate hint under the rate box (quotation / sales invoice) */
.mc-ratehint { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mc-ratehint[hidden] { display: none; }
.mc-ratehint__b { border: 1px solid var(--line); background: var(--soft); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mc-ratehint__b b { color: var(--ink); }
.mc-ratehint__b.is-list { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }

/* language switch */
.mc-lang { height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.mc-lang:hover { border-color: var(--brand); color: var(--brand-700); }
html[lang="gu"] body { font-family: 'Noto Sans Gujarati', 'Hind Vadodara', 'Shruti', var(--font); }

@media (max-width: 900px) { .mc-ch-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .mc-jb-card { padding: 12px; }
    .mc-jb-card__head { flex-direction: column; }
    .mc-jb-card__acts .btn span { display: none; }
    .mc-jb-card__acts .btn-primary span, .mc-jb-card__acts .btn-primary { flex: 1; justify-content: center; }
    .mc-jb-steps li span { display: none; }
    .mc-ch-dl { grid-template-columns: 1fr; }
    .mc-ch-save .btn { flex: 1; justify-content: center; }
    .mc-ds-grid { grid-template-columns: 1fr 1fr; }
    .mc-ds-tile { padding-left: 14px; padding-top: 44px; }
    .mc-ds-tile b { font-size: 16px; }
    .mc-rl-catacts { margin-left: 0; }
}

/* Update 15: recent customers on the bill screens / vehicles used before on the challan */
.mc-recent, .mc-ch-hints { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.mc-ch-hints { margin: 0 0 12px; }
.mc-recent > span, .mc-ch-hints > span { color: var(--muted); font-size: 12px; font-weight: 700; margin-right: 2px; display: inline-flex; align-items: center; gap: 4px; }
.mc-recent__b { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 4px 12px; font-size: 12.5px; color: var(--text); cursor: pointer; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-recent__b:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.mc-recent__b b { color: var(--ink); }
.bootstrap-select .dropdown-menu li a .text-muted, .bootstrap-select .dropdown-menu li a small { color: var(--muted) !important; margin-left: 6px; font-size: 12px; }
.bootstrap-select .bs-searchbox .form-control { height: 40px; }
/* customer search box on the bill screens */
.mc-cbx-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; }
.mc-cbx { position: relative; }
.mc-cbx > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; pointer-events: none; }
.mc-cbx input.form-control { padding-left: 36px; padding-right: 36px; height: 44px; font-weight: 600; color: var(--ink); }
.mc-cbx__x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.mc-cbx__x:hover { background: var(--soft); color: var(--ink); }
.mc-cbx__x[hidden], .mc-cbx__list[hidden] { display: none; }
.mc-cbx__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1060; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); max-height: 320px; overflow: auto; padding: 4px; }
.mc-cbx__it { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; }
.mc-cbx__it b { color: var(--ink); font-weight: 700; }
.mc-cbx__it small { color: var(--muted); font-size: 12px; }
.mc-cbx__it.is-cur, .mc-cbx__it:hover { background: var(--brand-50); }
.mc-cbx__none { padding: 10px; color: var(--muted); }
.mc-cbx__add { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--line-2); margin-top: 4px; font-weight: 700; }

/* ================================================================ Update 21: Add Items popup (Quotation) */
.mc-ai .modal-content { display: flex; flex-direction: column; }
.mc-ai .modal-title small.mc-ai__count { font-size: 13px; color: var(--green); font-weight: 700; }
.mc-ai__grab { display: none; }
.mc-ai__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.mc-ai__foot > * { margin: 0 !important; }
.mc-ai__total { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mc-ai__total span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mc-ai__total b { font-size: 18px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.mc-ai__total.is-zero b { color: var(--faint, #9fb3bb); }
.mc-ai__btns { display: flex; gap: 8px; }
.mc-ai__btns .btn { height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.mc-ai__btns .btn-light { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.mc-ai__btns .btn-primary { box-shadow: 0 6px 16px rgba(50,189,234,.3); }

/* one-tap chips instead of the Molding / Sand fitting dropdowns */
.mc-ai__has-chips .select2-container, .mc-ai__has-chips select { display: none !important; }
.mc-ai__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mc-ai__chip { height: 38px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--input, #d7e4ea); background: var(--card); color: var(--text); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.mc-ai__chip:hover { border-color: var(--brand-200); background: var(--brand-50); }
.mc-ai__chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-ai__chip:focus-visible { outline: 2px solid var(--brand-200); outline-offset: 2px; }
#exampleModalScrollable.mc-ai [class*="col-md-4"]:has(.mc-ai__chips--mold) { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 640px) {
    /* bottom sheet */
    .mc-ai .modal-dialog, .mc-ai .modal-dialog.modal-dialog-centered, .mc-ai .modal-dialog.modal-dialog-scrollable {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0; width: 100%; max-width: none;
        min-height: 0; height: auto; max-height: min(94dvh, var(--mc-ai-vh, 100dvh)); display: flex; align-items: flex-end;
    }
    .mc-ai.fade .modal-dialog { transform: translateY(100%); transition: transform .22s ease-out; }
    .mc-ai.show .modal-dialog { transform: none; }
    .mc-ai .modal-dialog-scrollable .modal-content, .mc-ai .modal-content { width: 100%; max-height: min(94dvh, var(--mc-ai-vh, 100dvh)); overflow: hidden; border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(15,61,79,.2); }
    .mc-ai .modal-dialog.modal-xl .modal-content { min-height: 0; border-radius: 20px 20px 0 0; }
    .mc-ai .modal-body { flex: 1 1 auto; min-height: 0; }
    .mc-ai .modal-header { position: relative; padding: 14px 16px 8px; align-items: center; }
    .mc-ai__grab { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #cfdde3; }
    .mc-ai .modal-title { font-size: 16px; }
    .mc-ai .modal-body { padding: 8px 12px 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .mc-ai .modal-body hr { display: none; }
    .mc-ai .modal-body h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 4px !important; }
    .mc-ai .modal-body label { font-size: 12px; margin-bottom: 3px; }
    .mc-ai .modal-body .form-group, .mc-ai .modal-body .mb-2 { margin-bottom: 8px !important; }
    .mc-ai .modal-body .form-control { height: 44px; font-size: 16px; }   /* 16px: iPhone does not zoom in */
    .mc-ai .modal-body .help-block:empty, .mc-ai .modal-body .help-block { margin: 0; min-height: 0; }
    .mc-ai .modal-body .col-md-4, .mc-ai .modal-body .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .mc-ai .modal-body .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .mc-ai .modal-body .mc-ai__dim { flex: 0 0 33.333%; max-width: 33.333%; padding-left: 5px; padding-right: 5px; }
    .mc-ai .modal-body .mc-ai__half { flex: 0 0 50%; max-width: 50%; padding-left: 5px; padding-right: 5px; }
    #exampleModalScrollable.mc-ai .modal-body [class*="col-md-4"]:has(.mc-ai__chips), #exampleModalScrollable.mc-ai .modal-body [class*="col-md-6"]:has(.mc-ai__chips) { flex: 0 0 100%; max-width: 100%; }
    .mc-ai .mc-ai__hide-sm { display: none; }
    .mc-ai .modal-body [class*="col-md-6"], .mc-ai .modal-body [class*="col-md-4"] { padding-left: 5px; padding-right: 5px; }
    .mc-ai .modal-body .row { margin-left: -5px; margin-right: -5px; }
    .mc-ai__foot { padding: 8px 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .mc-ai__btns .btn { height: 48px; padding: 0 14px; }
    .mc-ai__total b { font-size: 16px; }
}
@media (max-width: 380px) { .mc-ai__btns .mc-ai__close { padding: 0 10px; } .mc-ai__total b { font-size: 15px; } }
@media (max-width: 640px) {
    .mc-ai .modal-body .mc-ai__dim label, .mc-ai .modal-body .mc-ai__half label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Update 22: iPhone zooms in when a box with text smaller than 16px gets the cursor - after that the bottom menu
   and other fixed bars are drawn in the wrong place. All input boxes use 16px on phones. */
@media (max-width: 767px) {
    input.form-control, select.form-control, textarea.form-control, .mc-lv__search input, .select2-search__field,
    input[type=text], input[type=search], input[type=number], input[type=tel], input[type=email], input[type=password], input[type=date], textarea {
        font-size: 16px !important;
    }
}

/* Update 24: an open dropdown inside Add Items on phones = panel over the visible screen (above the keyboard) */
@media (max-width: 640px) {
    .select2-container.mc-ai-dd { position: fixed !important; left: 8px !important; right: 8px !important; top: var(--mc-dd-top, 8px) !important; width: auto !important; z-index: 1070 !important; }
    .mc-ai-dd .select2-dropdown { position: static !important; width: 100% !important; border: 1px solid var(--line) !important; border-radius: 14px !important; overflow: hidden; box-shadow: 0 16px 40px rgba(15,61,79,.28); }
    .mc-ai-dd .select2-search--dropdown { padding: 10px; }
    .mc-ai-dd .select2-search__field { height: 44px; border-radius: 10px; padding: 0 12px; }
    .mc-ai-dd .select2-results > .select2-results__options { max-height: var(--mc-dd-h, 60vh) !important; -webkit-overflow-scrolling: touch; }
    .mc-ai-dd .select2-results__option { padding: 13px 14px; font-size: 16px; border-bottom: 1px solid var(--line-2); }
    .mc-ai-dd.mc-ai-dd--nosearch .select2-search--dropdown { display: none !important; }
}

/* ================================================================ Update 23: bill screens on phones (Sales / Purchase / Quotation) */
@media (max-width: 640px) {
    /* item entry: product on its own line, small fields 3 in a row, Add button next to Total */
    .or-detail { padding: 10px 6px 4px !important; }
    .or-detail > [class*="col-md-"] { flex: 0 0 33.333%; max-width: 33.333%; padding-left: 5px; padding-right: 5px; margin-bottom: 8px; }
    .or-detail > .col-md-12, .or-detail > .col-md-4:first-of-type, .or-detail > [class*="col-md-"]:has(.select) { flex: 0 0 100%; max-width: 100%; }
    .or-detail > [class*="col-md-"]:has(#btnAdd) { flex: 1 1 0; max-width: none; display: flex; align-items: flex-end; margin-top: 0 !important; }
    .or-detail > [class*="col-md-"]:has(#btnAdd) #btnAdd { height: 44px; border-radius: 12px; font-weight: 700; }
    .or-detail label { font-size: 12px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .or-detail .form-control { height: 44px; }
    .or-detail .help-block { margin: 0; }
    .or-detail .mt-1 { margin-top: 0 !important; }

    /* items table -> one card per item */
    .mc-items-wrap { overflow: visible; border: 0; }
    .mc-items-wrap #tblProducts, #tblProducts { min-width: 0 !important; width: 100%; display: block; }
    #tblProducts thead { display: none; }
    #tblProducts tbody { display: flex; flex-direction: column; gap: 8px; }
    #tblProducts tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
    #tblProducts tbody td { display: block; border: 0 !important; padding: 0 !important; min-width: 0; font-size: 13px; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #tblProducts tbody td::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
    #tblProducts tbody td.mc-td-name { grid-column: 1 / -1; font-size: 14.5px; font-weight: 900; padding-right: 44px !important; white-space: normal; }
    #tblProducts tbody td.mc-td-name::before { display: none; }
    #tblProducts tbody td.mc-td-act { position: absolute; top: 8px; right: 8px; }
    #tblProducts tbody td.mc-td-act::before { display: none; }
    #tblProducts tbody td.mc-td-act .btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
    #tblProducts tbody td.mc-td-sum { color: var(--brand-700); }
    #tblProducts tbody td.mc-td-zero { display: none; }
    #tblProducts tfoot { display: block; }
    #tblProducts tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 4px 0; }
    #tblProducts tfoot td, #tblProducts tfoot th { border: 0 !important; padding: 0 !important; }

    /* save bar: total, Save and Cancel in one row */
    .mc-doc2__bar { flex-wrap: nowrap !important; padding: 8px 10px; gap: 8px; }
    .mc-doc2__bar .mc-doc-total, .mc-doc2__bar .mc-savebar__total { order: -1; width: auto !important; flex: 1 1 auto; flex-direction: column !important; align-items: flex-start !important; justify-content: center; margin: 0; min-width: 0; }
    .mc-doc2__bar .mc-doc-total b { font-size: 18px; white-space: nowrap; }
    .mc-doc2__bar .btn { flex: 0 0 auto !important; height: 44px; padding: 0 14px; margin: 0 !important; border-radius: 12px; }
    .mc-doc2__bar .btn-light { padding: 0 12px; }
    .mc-doc2 { padding-bottom: 8px; }
}

/* ================================================================ Update 25: faster item entry */
/* snackbar with Undo */
.mc-snack { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 100020; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px);
    background: #1e293b; color: #fff; border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 12px 30px rgba(15,23,42,.3); opacity: 0; pointer-events: none; transition: all .2s; font-size: 14px; }
.mc-snack.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.mc-snack span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-snack button { flex: none; border: 0; background: rgba(255,255,255,.14); color: #7dd8f5; font-weight: 900; border-radius: 10px; height: 36px; padding: 0 14px; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
@media (min-width: 992px) { .mc-snack { bottom: 24px; } }

/* tap an item to edit */
html.mc-items-edit #tblProducts tbody tr { cursor: pointer; }
html.mc-items-edit #tblProducts tbody tr:hover td { background: var(--brand-50); }
.mc-row-flash td, #tblProducts tbody tr.mc-row-flash { animation: mcflash 1.4s ease-out; }
@keyframes mcflash { 0% { background: #fff4c2; } 100% { background: transparent; } }
.mc-edit-bar { display: flex; align-items: center; gap: 10px; background: #fff7e6; border: 1px solid #f4dba4; color: #7a4d00; border-radius: 12px; padding: 8px 10px 8px 12px; margin: 0 0 10px; width: 100%; flex: 0 0 100%; }
.mc-edit-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-edit-bar b { color: #4f3300; }
.mc-edit-bar .btn { flex: none; }
.or-detail > .mc-edit-bar { margin: 0 5px 10px; }
@media (max-width: 640px) { #tblProducts tbody tr::after { content: 'Tap to edit'; position: absolute; right: 52px; top: 12px; font-size: 10.5px; font-weight: 700; color: var(--faint, #9fb3bb); text-transform: uppercase; letter-spacing: .03em; } }

/* draft banner */
.mc-draft { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #eef8fd; border: 1px solid var(--brand-200); border-radius: 14px; padding: 10px 14px; margin: 0 0 12px; }
.mc-draft > i { font-size: 24px; color: var(--brand-600); }
.mc-draft > div { flex: 1; min-width: 180px; }
.mc-draft b { display: block; color: var(--ink); }
.mc-draft span { color: var(--muted); font-size: 13px; }

/* tools row in the Add Items popup */
.mc-ai-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; width: 100%; flex: 0 0 100%; padding: 0 15px; }
.mc-ai-tool { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 20px; border: 1px dashed var(--brand-200); background: var(--card); color: var(--brand-700); font-weight: 700; font-size: 12.5px; }
.mc-ai-tool i { font-size: 16px; }
.mc-ai-tool.is-on { background: var(--brand); border-style: solid; border-color: var(--brand); color: #fff; }
.mc-ai-tool.is-rec { background: #fdecec; border-color: #f2b5b5; color: #c0392b; animation: mcpulse 1s infinite; }
@keyframes mcpulse { 50% { box-shadow: 0 0 0 6px rgba(220,75,75,.15); } }
.mc-ai-fav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 0 15px; width: 100%; flex: 0 0 100%; }
.mc-ai-fav[hidden] { display: none; }
.mc-ai-fav__l { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mc-ai-fav__l i { color: #e0a100; }
.mc-ai-fav__c { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-ai-fav .mc-ai__chip { height: 34px; padding: 0 12px; font-variant-numeric: tabular-nums; }

/* feet + inch */
.mc-ftin { display: flex; align-items: center; gap: 4px; }
.mc-ftin[hidden] { display: none; }
.mc-ftin .form-control { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 4px; }
.mc-ftin span { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.form-control.mc-ftin-real { display: none !important; }

/* many sizes */
.mc-many { width: 100%; flex: 0 0 100%; margin: 0 15px 10px; border: 1px solid var(--brand-200); border-radius: 14px; background: #f7fcfe; padding: 10px; max-width: calc(100% - 30px); }
.mc-many[hidden] { display: none; }
.mc-many__head b { display: block; color: var(--ink); }
.mc-many__head span { font-size: 12.5px; color: var(--muted); }
.mc-many__grid { margin-top: 8px; }
.mc-many__h, .mc-many__r { display: grid; grid-template-columns: 26px 1fr 1fr 1fr 34px; gap: 6px; align-items: center; }
.mc-many__h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 0 0 4px; }
.mc-many__r { margin-bottom: 6px; }
.mc-many__r .n { font-weight: 900; color: var(--muted); text-align: center; font-size: 12.5px; }
.mc-many__r .form-control { height: 42px; padding: 0 8px; }
.mc-many__r.is-bad .form-control { border-color: #e7a3a3; background: #fff5f5; }
.mc-many__x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.mc-many__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.mc-many__foot .btn { display: inline-flex; align-items: center; gap: 4px; height: 40px; border-radius: 12px; font-weight: 700; }
.mc-many-off { display: none !important; }

/* QR scanner */
.mc-scan { position: fixed; inset: 0; z-index: 100030; background: rgba(15,23,42,.75); display: flex; align-items: center; justify-content: center; padding: 12px; }
.mc-scan__box { width: 100%; max-width: 460px; background: var(--card); border-radius: 18px; overflow: hidden; }
.mc-scan__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; }
.mc-scan__head b { color: var(--ink); }
.mc-scan__cam { position: relative; background: #000; aspect-ratio: 1 / 1; }
.mc-scan__cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-scan__aim { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.mc-scan__msg { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); padding: 0 12px; }
.mc-scan__type { display: flex; gap: 8px; padding: 12px; }
.mc-scan__type .form-control { height: 44px; }
.mc-scan__type .btn { height: 44px; border-radius: 12px; font-weight: 700; }
.mc-many__foot .btn-success { background: var(--green, #1f9d6b) !important; border-color: var(--green, #1f9d6b) !important; color: #fff !important; }
.mc-ai--many .mc-ai-fav { display: none !important; }

/* ================================================================ Update 25: Today tiles (home screen) */
.mc-today { margin: 0 0 16px; }
.mc-today:empty { display: none; }
.mc-today__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.mc-today__head b { font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.mc-today__head b i { color: #e0a100; }
.mc-today__head span { color: var(--muted); font-size: 13px; }
/* Update 26: compact tiles - icon on the left, number + text on the right (same look as the quick action cards) */
.mc-today__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.mc-today__tile { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none !important; color: var(--ink) !important; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.mc-today__tile:hover { border-color: var(--brand-200); box-shadow: 0 6px 18px rgba(15,61,79,.08); }
.mc-today__ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.mc-today__ico i { font-size: 21px; line-height: 1; display: block; width: auto; height: auto; margin: 0; background: none; }
.mc-today__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.mc-today__txt b { font-size: 22px; font-weight: 900; color: var(--ink); }
.mc-today__txt span { font-size: 12.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-today__txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-today__tile.is-zero .mc-today__txt b { color: var(--faint, #9fb3bb); }
.mc-today__tile.is-zero .mc-today__ico { filter: grayscale(.6); opacity: .7; }
.mc-today__tile.is-amber .mc-today__ico { background: #fff4e0; color: #b87400; }
.mc-today__tile.is-blue .mc-today__ico { background: var(--brand-50); color: var(--brand-700); }
.mc-today__tile.is-green .mc-today__ico { background: #e2f6ec; color: var(--green, #1f9d6b); }
.mc-today__tile.is-orange .mc-today__ico { background: #ffeede; color: #c2611a; }
.mc-today__tile.is-violet .mc-today__ico { background: #efeafd; color: #6a4cc7; }
.mc-today__tile.is-red .mc-today__ico { background: #fdecec; color: #c0392b; }
@media (max-width: 1399px) { .mc-today__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mc-today__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .mc-today__tile { padding: 8px 10px; gap: 10px; min-height: 58px; } .mc-today__ico { width: 38px; height: 38px; } .mc-today__txt b { font-size: 19px; } }
.mc-nudge { margin-top: 10px; background: var(--card); border: 1px solid #f4dba4; border-radius: 16px; padding: 10px 14px; }
.mc-nudge__head { display: flex; align-items: center; gap: 8px; color: #7a4d00; width: 100%; border: 0; background: none; padding: 4px 0; text-align: left; font: inherit; cursor: pointer; }
.mc-nudge__head b { flex: 1; }
.mc-nudge__chev { transition: transform .2s; color: #b87400; }
.mc-nudge__head[aria-expanded="true"] .mc-nudge__chev { transform: rotate(180deg); }
.mc-nudge__more { display: block; color: var(--muted); padding-top: 6px; }
.mc-noreply-host { margin-bottom: 12px; }
.mc-noreply-host:empty { display: none; }
.mc-nudge__head i { font-size: 20px; color: #e0a100; }
.mc-nudge ul { list-style: none; margin: 0; padding: 0; }
.mc-nudge li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.mc-nudge li b { display: block; color: var(--ink); font-size: 13.5px; }
.mc-nudge li small { color: var(--muted); font-size: 12px; }
.mc-nudge .btn { flex: none; display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; }

/* ================================================================ Change Rates */
.mc-br { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.mc-br label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0; }
.mc-br label .form-control { margin-top: 4px; height: 44px; }
.mc-br__row { margin-bottom: 10px; }
.mc-br__row--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mc-br__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-br__btns .btn { height: 44px; display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; font-weight: 700; }
.mc-br__sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mc-br__sum b { color: var(--ink); }
.mc-br__sum span { color: var(--muted); font-size: 13px; flex: 1; }
.mc-br__all { display: inline-flex !important; align-items: center; gap: 6px; }
.mc-br__list { max-height: 60vh; overflow-y: auto; border-top: 1px solid var(--line-2); }
.mc-br__it { display: grid !important; grid-template-columns: 22px minmax(0, 1fr) auto 16px auto; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line-2); font-size: 13.5px !important; color: var(--ink) !important; cursor: pointer; }
.mc-br__it input { width: 18px; height: 18px; }
.mc-br__it .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mc-br__it .o { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.mc-br__it .v { font-weight: 900; }
.mc-br__it .v.up { color: var(--green, #1f9d6b); }
.mc-br__it .v.down { color: #c0392b; }
.mc-br__it.is-same { opacity: .55; }
.mc-br__it.is-same .o { text-decoration: none; }
.mc-br__h { font-size: 15px; color: var(--ink); font-weight: 900; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.mc-br__hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.mc-br__hrow b { display: block; color: var(--ink); font-size: 13.5px; }
.mc-br__hrow small { color: var(--muted); }
@media (max-width: 640px) { .mc-br__row--3 { grid-template-columns: 1fr 1fr; } .mc-br__row--3 label:last-child { grid-column: 1 / -1; } }

/* ================================================================ Customer page */
.mc-c360 { display: flex; flex-direction: column; gap: 14px; }
.mc-c360__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mc-c360__kpis .k { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.mc-c360__kpis small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mc-c360__kpis b { display: block; font-size: 20px; font-weight: 900; color: var(--ink); }
.mc-c360__kpis span { font-size: 12px; color: var(--muted); }
.mc-c360__kpis .is-due b { color: #c0392b; }
.mc-c360__kpis .is-ok b { color: var(--green, #1f9d6b); }
.mc-c360__quick { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-c360__quick .btn { height: 42px; display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; font-weight: 700; }
.mc-c360__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mc-c360__tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.mc-c360__tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 20px; height: 34px; padding: 0 12px; font-weight: 700; color: var(--text); font-size: 13px; }
.mc-c360__tabs button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-c360__tabs small { opacity: .75; }
.mc-c360__bill { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line-2); text-decoration: none !important; color: var(--ink) !important; }
.mc-c360__bill:hover { background: var(--soft); }
.mc-c360__bill b { display: block; font-size: 14px; }
.mc-c360__bill small { color: var(--muted); font-size: 12px; }
.mc-c360__bill .a { font-weight: 900; white-space: nowrap; }
.mc-c360__pay { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.mc-c360__pay b { display: block; font-size: 13.5px; color: var(--ink); }
.mc-c360__pay small { color: var(--muted); font-size: 12px; }
.mc-c360__pay span { font-weight: 900; color: var(--green, #1f9d6b); white-space: nowrap; }
.mc-c360__empty { color: var(--muted); padding: 14px 0; text-align: center; }
.mc-c360__addr { display: flex; gap: 10px; color: var(--text); }
.mc-c360__addr i { color: var(--brand-600); font-size: 20px; }
@media (max-width: 991px) { .mc-c360__grid { grid-template-columns: 1fr; } .mc-c360__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mc-c360__bill { grid-template-columns: auto minmax(0, 1fr) auto; } .mc-c360__bill .mc-chip:not(:first-child) { display: none; } .mc-page-head__actions .btn span { display: none; } }

/* ================================================================ guided tour */
.mc-tour { position: fixed; inset: 0; z-index: 100040; }
.mc-tour__hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15,23,42,.62); transition: all .25s ease; pointer-events: none; }
.mc-tour__tip { position: fixed; width: 280px; background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.mc-tour__tip small { color: var(--brand-700); font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.mc-tour__tip b { display: block; color: var(--ink); font-size: 17px; margin: 2px 0 4px; }
.mc-tour__tip p { margin: 0 0 10px; color: var(--text); font-size: 13.5px; line-height: 1.45; }
.mc-tour__btns { display: flex; justify-content: space-between; }

/* ================================================================ large text and dark mode (this device) */
/* only the page content is bigger: the fixed bars (top, bottom menu) and pop-ups keep their size so they stay on the screen */
html.mc-big .mc-container { zoom: 1.12; overflow-x: clip; }
html.mc-big .mc-container .modal { zoom: .893; }

/* Update 26: QuotationSettings.aspx - Update Product / Remove Molding / Remove Sand Fitting */
.mc-qs-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.mc-qs-btns .btn { height: 44px; border-radius: 12px; font-weight: 700; padding: 0 18px; margin: 0 !important; }
@media (max-width: 640px) {
    .mc-qs-btns { display: grid; grid-template-columns: 1fr 1fr; }
    .mc-qs-btns .btn { width: 100%; padding: 0 8px; white-space: normal; line-height: 1.15; }
    .mc-qs-btns .btn-primary { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .mc-dash-head__period { min-width: 0; max-width: 100%; overflow-x: clip; } }
@media (max-width: 640px) { .mc-today__txt span { white-space: normal; overflow: visible; font-size: 12px; line-height: 1.2; } .mc-noreply-host { margin: 0 0 12px; } }
/* Update 27: "Used most" on phones - label on its own line, the (max 4) sizes centred */
@media (max-width: 640px) {
    .mc-ai-fav { flex-direction: column; align-items: center; gap: 6px; }
    .mc-ai-fav__c { justify-content: center; }
    .mc-ai-tools { justify-content: center; }
}

/* ================================================================ Update 29 */
/* tables could not be scrolled sideways (the rounded box had overflow:hidden) - now they scroll */
.table-responsive:has(> table.table), .table-responsive:has(> .dataTables_wrapper), .dataTables_wrapper { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table-responsive:has(.dropdown-menu.show), .dataTables_wrapper:has(.dropdown-menu.show) { overflow: visible; }

/* Admin pages on phones: every row becomes a card, buttons always in view */
@media (max-width: 767px) {
    body.mc-adminpg .table-responsive, body.mc-adminpg .dataTables_wrapper { overflow: visible !important; border: 0 !important; background: transparent !important; }
    body.mc-adminpg .table-responsive table.table, body.mc-adminpg .table-responsive table.dataTable { display: block; width: 100% !important; min-width: 0 !important; border: 0; margin: 0 !important; background: transparent; }
    body.mc-adminpg .table-responsive table.table thead { display: none; }
    body.mc-adminpg .table-responsive table.table tbody { display: flex; flex-direction: column; gap: 10px; }
    body.mc-adminpg .table-responsive table.table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px;
        background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
    body.mc-adminpg .table-responsive table.table tbody tr:hover td { background: transparent; }
    body.mc-adminpg .table-responsive table.table tbody td { display: block; padding: 0 !important; border: 0 !important; background: transparent !important; min-width: 0;
        font-size: 13.5px; text-align: left !important; white-space: normal !important; word-break: break-word; }
    body.mc-adminpg .table-responsive table.table tbody td::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
        letter-spacing: .04em; color: var(--muted); margin-bottom: 1px; }
    body.mc-adminpg .table-responsive table.table tbody td[data-label=""]::before { display: none; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-head { grid-column: 1 / -1; order: -1; font-size: 15px; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act { order: 99; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-head::before { display: none; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-wide { grid-column: 1 / -1; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-empty { display: none; }
    /* the buttons: full width at the bottom of the card */
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px !important;
        border-top: 1px dashed var(--line) !important; margin-top: 2px; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act::before { display: none; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act > .btn, body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act > a.btn { flex: 1 1 0; height: 44px; display: inline-flex;
        align-items: center; justify-content: center; gap: 6px; border-radius: 12px; font-size: 14px; font-weight: 700; margin: 0; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act > .btn-light:only-of-type:not(:first-child) { flex: 0 0 56px; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act .dropdown { flex: 1 1 100%; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act .dropdown > .btn { width: 100%; height: 44px; border-radius: 12px; font-weight: 700; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act .dropdown-menu { position: static !important; transform: none !important; inset: auto !important; float: none; width: 100%; margin: 6px 0 0; box-shadow: none; border: 1px solid var(--line); border-radius: 12px; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-act .dropdown-item { padding: 11px 16px; }
    body.mc-adminpg .table-responsive table.table tbody td.dataTables_empty { grid-column: 1 / -1; text-align: center !important; }
    body.mc-adminpg .table-responsive table.table tbody td.dataTables_empty::before { display: none; }
    /* DataTables search / pages under the cards */
    body.mc-adminpg div.dataTables_wrapper div.dataTables_filter { padding: 0 0 10px; border: 0; }
    body.mc-adminpg div.dataTables_wrapper div.dataTables_info { padding: 10px 2px 0 !important; text-align: center; }
    body.mc-adminpg div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: center; flex-wrap: wrap; }
    /* tabs / filters row scrolls sideways instead of being cut off */
    body.mc-adminpg .mc-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    body.mc-adminpg .mc-tabs::-webkit-scrollbar { display: none; }
    body.mc-adminpg .mc-tabs > a { flex: 0 0 auto; white-space: nowrap; }
    body.mc-adminpg .mc-page-head { flex-wrap: wrap; gap: 10px; }
    body.mc-adminpg .mc-page-head__actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    body.mc-adminpg .mc-page-head__actions > .btn { flex: 1 1 auto; }
    body.mc-adminpg .modal-footer .btn { min-height: 44px; }
}

/* Sales / Purchase bill screens on phones: cleaner item entry (2 fields per row, big Add button) */
@media (max-width: 767px) {
    .mc-sec__body .or-detail { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: 16px !important; padding: 12px 8px 4px !important;
        box-shadow: 0 2px 10px rgba(15, 23, 42, .05); margin-top: 0 !important; }
    .mc-sec__body .or-detail > .col-md-12:empty, .mc-sec__body .or-detail > .col-md-12:not(:has(*)) { display: none; }
    .mc-sec__body .or-detail > [class*="col-md-"] { flex: 0 0 50% !important; max-width: 50% !important; padding-left: 6px !important; padding-right: 6px !important; margin: 0 0 10px !important; }
    .mc-sec__body .or-detail > [class*="col-md-"]:has(.select), .mc-sec__body .or-detail > [class*="col-md-"]:has(select),
    .mc-sec__body .or-detail > .col-md-12, .mc-sec__body .or-detail > .mc-edit-bar { flex: 0 0 100% !important; max-width: 100% !important; }
    .mc-sec__body .or-detail > [class*="col-md-"]:has(#btnAdd) { flex: 0 0 100% !important; max-width: 100% !important; display: block; margin: 2px 0 10px !important; }
    .mc-sec__body .or-detail #btnAdd, .mc-sec__body .or-detail > [class*="col-md-"]:has(#btnAdd) .btn { width: 100%; height: 48px !important; border-radius: 12px; font-size: 15px; font-weight: 800; }
    .mc-sec__body .or-detail label { font-size: 12.5px !important; font-weight: 700; color: var(--muted); margin-bottom: 4px !important; white-space: normal !important; overflow: visible !important; }
    .mc-sec__body .or-detail .form-control, .mc-sec__body .or-detail .select2-container .select2-selection--single { height: 46px !important; border-radius: 12px !important; font-size: 16px !important; }
    .mc-sec__body .or-detail .select2-container .select2-selection--single .select2-selection__rendered { line-height: 44px !important; }
    .mc-sec__body .or-detail .select2-container .select2-selection--single .select2-selection__arrow { height: 44px !important; }
    .mc-sec__body .or-detail .form-control::placeholder { color: #b6c0cc; }
    .mc-sec__body .or-detail .form-control:disabled, .mc-sec__body .or-detail .form-control[readonly] { background: var(--soft) !important; color: var(--ink); }
    .mc-sec__body .or-detail > [class*="col-md-"]:has(input[id$="_txtTotal"]) { flex: 0 0 100% !important; max-width: 100% !important; }
    .mc-sec__body .or-detail input[id$="_txtTotal"] { font-weight: 800; color: var(--brand-700, #0e7490); background: #ecfbff !important; }
    .mc-sec__body .or-detail .help-block { margin: 2px 0 0 !important; font-size: 11.5px; min-height: 0; }
    .mc-sec__body .or-detail .mt-1, .mc-sec__body .or-detail .mt-2 { margin-top: 0 !important; }

    /* e-way bill / ship-to switches: one per line, left aligned */
    .mc-sec__body .checkbox-wrap { flex-direction: column; align-items: stretch; gap: 8px; margin: 0 0 12px !important; }
    .mc-sec__body .checkbox-wrap > label { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; background: var(--soft); border: 1px solid var(--line);
        border-radius: 12px; font-size: 14px; }
    .mc-sec__body .checkbox-wrap > label .checkbox-input { margin: 0 !important; display: inline-flex; }
    .mc-sec__body .checkbox-wrap > label input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
    .mc-sec__body .checkbox-wrap > label > i { color: var(--brand); font-size: 18px; }

    /* distance: the two helper links go under the box */
    .mc-sec__body .input-group:has(#basic-addon5), .mc-sec__body .input-group:has([id$="basic-addon5"]) { flex-wrap: wrap; }
    .mc-sec__body .input-group:has(#basic-addon5) > .form-control { flex: 1 1 100%; width: 100%; border-radius: 12px !important; }
    .mc-sec__body .input-group:has(#basic-addon5) > .input-group-append { flex: 1 1 100%; margin: 6px 0 0; }
    .mc-sec__body .input-group:has(#basic-addon5) .input-group-text { width: 100%; display: flex; gap: 8px; padding: 0; background: transparent; border: 0; }
    .mc-sec__body .input-group:has(#basic-addon5) .input-group-text a { flex: 1 1 0; margin: 0 !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 13px; font-weight: 700; }
}

/* ================================================================ Update 30 */
.mc-u30 .mc-minis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#mcRevenue .mc-minis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mc-mini--red i { background: #fdecec; color: #c0392b; }

/* year-end stock */
.mc-ye__years { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.mc-ye__years label { flex: 1 1 200px; margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mc-ye__years label .form-control { margin-top: 4px; }
.mc-ye__years > i { font-size: 20px; color: var(--muted); padding-bottom: 10px; }
.mc-ye__years .btn { height: 42px; }
.mc-ye__help { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.mc-ye__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mc-ye__bar .mc-lv__search { flex: 1 1 220px; max-width: 380px; }
.mc-ye__chk { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.mc-ye__chk input { width: 18px; height: 18px; }
.mc-ye__in { max-width: 140px; margin-left: auto; text-align: right; font-weight: 700; }
.mc-ye__in.is-diff { border-color: #f0a33c !important; background: #fff8ec !important; }
.mc-ye__last { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-50); color: var(--ink); font-size: 13.5px; }
.mc-ye__last--warn { background: #fff6e5; color: #8a5a00; }
.mc-ye__save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px;
    padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
.mc-ye__save .btn { height: 44px; border-radius: 12px; font-weight: 800; }
.mc-ye__t .mc-sub { display: block; font-size: 11.5px; color: var(--muted); }

/* bill profit */
.mc-bp__form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.mc-bp__form label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mc-bp__form label .form-control { margin-top: 4px; }
.mc-bp__form .btn { height: 42px; }

/* workers */
.mc-wk__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mc-wk__month { display: flex; align-items: center; gap: 10px; }
.mc-wk__month b { min-width: 140px; text-align: center; font-size: 16px; color: var(--ink); }
.mc-wk__day { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mc-wk__day label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mc-wk__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.mc-wk__who { min-width: 0; }
.mc-wk__who b { display: block; color: var(--ink); cursor: pointer; }
.mc-wk__who small { color: var(--muted); }
.mc-wk__btns { display: flex; gap: 6px; flex: 0 0 auto; }
.mc-wk__b { height: 40px; min-width: 64px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; color: var(--text); }
.mc-wk__b.mc-wk__more { min-width: 40px; }
.mc-wk__b.is-P.on { background: #e6f7ee; border-color: #22a361; color: #157a46; }
.mc-wk__b.is-H.on { background: #fff4df; border-color: #e59a1a; color: #94600a; }
.mc-wk__b.is-A.on { background: #fdecec; border-color: #d9534f; color: #a3302c; }
.mc-wk__grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mc-wk__t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.mc-wk__t th, .mc-wk__t td { padding: 0; text-align: center; border-bottom: 1px solid var(--line-2); }
.mc-wk__t th { background: var(--soft); color: var(--muted); font-weight: 700; height: 32px; min-width: 30px; }
.mc-wk__t th.is-sun { color: #c0392b; }
.mc-wk__t .mc-wk__name { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; padding: 6px 10px; min-width: 130px; max-width: 170px; border-right: 1px solid var(--line); }
.mc-wk__t thead .mc-wk__name { background: var(--soft); }
.mc-wk__t .mc-wk__name b { display: block; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.mc-wk__t .mc-wk__name small { color: var(--muted); }
.mc-wk__t td.c { height: 38px; min-width: 30px; cursor: pointer; font-weight: 800; position: relative; user-select: none; -webkit-user-select: none; }
.mc-wk__t td.c.is-P { background: #e6f7ee; color: #157a46; }
.mc-wk__t td.c.is-H { background: #fff4df; color: #94600a; }
.mc-wk__t td.c.is-A { background: #fdecec; color: #a3302c; }
.mc-wk__t td.c.is-future { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f4f7f9 4px, #f4f7f9 8px); cursor: default; }
.mc-wk__t td.c i { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.mc-wk__t td.t { font-weight: 800; padding: 0 10px; color: var(--ink); }

/* site photos */
.mc-ph__cam { height: 46px; display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; font-weight: 700; cursor: pointer; margin: 0; }
.mc-ph__prev { position: relative; display: inline-block; margin-top: 10px; }
.mc-ph__prev img { max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); display: block; }
.mc-ph__prev .btn { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.mc-ph__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.mc-ph__grid > .mc-md-empty { grid-column: 1 / -1; }
.mc-ph__it { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.mc-ph__img { display: block; aspect-ratio: 4 / 3; background: var(--soft); }
.mc-ph__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-ph__img--note { display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--faint); }
.mc-ph__txt { padding: 10px 12px 4px; flex: 1 1 auto; }
.mc-ph__txt p { margin: 0 0 4px; white-space: pre-wrap; color: var(--ink); font-size: 14px; }
.mc-ph__txt small { color: var(--muted); }
.mc-ph__acts { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 10px 10px; }

/* support */
.mc-sp__plan .card-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mc-sp__plan small { display: block; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.mc-sp__plan b { display: block; font-size: 18px; color: var(--ink); }
.mc-sp__plan span { color: var(--muted); font-size: 13px; }
.mc-sp__plan.is-warn { border-color: #f0a33c; background: #fffaf0; }
.mc-sp__new { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mc-sp__new .btn { height: 44px; border-radius: 12px; font-weight: 700; }
.mc-sp__list { display: flex; flex-direction: column; gap: 8px; }
.mc-sp__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mc-sp__row:hover { border-color: var(--brand-200); }
.mc-sp__row b { display: block; color: var(--ink); }
.mc-sp__row small { color: var(--muted); }
.mc-sp__row > span { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.mc-sp__row.is-unread { border-left: 4px solid var(--brand); }
.mc-sp__thread { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.mc-sp__msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 88%; }
.mc-sp__msg.is-admin { align-self: flex-end; align-items: flex-end; }
.mc-sp__bub { padding: 10px 12px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); white-space: normal; word-break: break-word; }
.mc-sp__msg.is-admin .mc-sp__bub { background: var(--brand-50); border-color: var(--brand-100); }
.mc-sp__msg small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mc-sp__prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mc-sp__price { margin: 0; cursor: pointer; }
.mc-sp__price input { position: absolute; opacity: 0; }
.mc-sp__price span { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.mc-sp__price span b { display: block; color: var(--ink); }
.mc-sp__price input:checked + span { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.mc-sp__qr { width: 190px; margin: 0 auto 10px; }
.mc-sp__qr svg { width: 100%; height: auto; display: block; }

/* admin revenue */
.mc-rev { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.mc-rev__bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.mc-rev__col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.mc-rev__col i { display: block; width: 100%; max-width: 34px; min-height: 2px; background: linear-gradient(180deg, var(--brand), var(--brand-600)); border-radius: 6px 6px 2px 2px; }
.mc-rev__col small { font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.mc-rev__col .v { font-size: 10px; color: var(--ink); font-weight: 700; margin-bottom: 2px; white-space: nowrap; }
.mc-rev__health.is-warn { border-color: #f0a33c; background: #fffaf0; }
.mc-rev__health p { margin-bottom: 6px; font-size: 13.5px; }
@media (max-width: 991px) { .mc-rev { grid-template-columns: 1fr; } }
@media (max-width: 575px) { .mc-rev__col .v { display: none; } .mc-rev__col small { font-size: 9px; } }

/* companies: bulk bar + tick boxes */
.mc-bulkbar { position: sticky; top: 64px; z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 14px;
    background: var(--ink); color: #fff; border-radius: 12px; }
.mc-bulkbar b { margin-right: 4px; }
.mc-bulkbar .btn-link { color: #fff; }
.mc-sel-cell { width: 34px; }
.mc-sel-cell input { width: 18px; height: 18px; }
@media (max-width: 767px) {
    body.mc-adminpg .table-responsive table.table tbody td.mc-sel-cell { position: absolute; top: 12px; right: 12px; }
    body.mc-adminpg .table-responsive table.table tbody tr { position: relative; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-ac-head { padding-right: 34px !important; }
    .mc-bulkbar { position: fixed; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; right: 10px; margin: 0; }
}

/* credit limit on bills */
.mc-credit { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 10px; border-radius: 10px; background: var(--brand-50); color: var(--ink); font-size: 13px; }
.mc-credit i { font-size: 16px; }
.mc-credit.is-near { background: #fff6e5; color: #8a5a00; }
.mc-credit.is-over { background: #fdecec; color: #a3302c; }

/* next step after saving a bill */
.mc-saved { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(15, 30, 40, 0); pointer-events: none; transition: background .25s; }
.mc-saved.is-on { background: rgba(15, 30, 40, .25); pointer-events: auto; }
.mc-saved__card { width: 100%; max-width: 480px; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: 0 10px 40px rgba(15, 23, 42, .25); transform: translateY(120%); transition: transform .28s ease;
    margin-bottom: env(safe-area-inset-bottom); }
.mc-saved.is-on .mc-saved__card { transform: none; }
.mc-saved__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mc-saved__head b { display: block; color: var(--ink); }
.mc-saved__head small { color: var(--muted); }
.mc-saved__head > div { flex: 1 1 auto; min-width: 0; }
.mc-saved__ok { flex: 0 0 40px; height: 40px; border-radius: 50%; background: #e6f7ee; color: #157a46; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.mc-saved__x { border: 0; background: transparent; font-size: 22px; color: var(--muted); width: 36px; height: 36px; }
.mc-saved__btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.mc-saved__btns .btn { height: 46px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* list cards: swipe for actions */
.mc-card-row { position: relative; transition: transform .2s ease; }
.mc-card-row.is-swiping, .mc-card-row.is-swiped { z-index: 2; background: var(--card); }
.mc-swipe { position: absolute; right: 0; z-index: 1; display: flex; width: 150px; overflow: hidden; }
.mc-swipe button { flex: 1 1 0; border: 0; background: var(--brand); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 0 2px; }
.mc-swipe button:nth-child(2) { background: #22a361; }
.mc-swipe button:nth-child(3) { background: var(--ink); }
.mc-swipe button i { font-size: 19px; }
.mc-swipe button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* pull down to refresh */
.mc-ptr { position: fixed; top: 58px; left: 50%; z-index: 1040; width: 38px; height: 38px; margin-top: -48px; border-radius: 50%; background: var(--card); box-shadow: 0 3px 12px rgba(15, 23, 42, .18);
    display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 20px; opacity: 0; transform: translate(-50%, 0); pointer-events: none; transition: opacity .15s; }
.mc-ptr.is-on { opacity: 1; transition: none; }
.mc-ptr.is-ready { color: var(--brand); }

/* reorder list */
.mc-ro { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.mc-ro__it { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.mc-ro__it > span { flex: 1 1 auto; min-width: 0; }
.mc-ro__it b { display: block; color: var(--ink); }
.mc-ro__it small { color: var(--muted); }
.mc-ro__it input[type=number] { width: 90px; text-align: right; }
.mc-ro__it input[type=checkbox] { width: 18px; height: 18px; }

@media (max-width: 767px) {
    .mc-ye__in { max-width: none; }
    .mc-ye__years > i { display: none; }
    .mc-ye__years .btn { width: 100%; }
    .mc-wk__btns .mc-wk__b { min-width: 0; padding: 0 9px; }
    .mc-wk__row { flex-wrap: wrap; }
    .mc-wk__btns { width: 100%; }
    .mc-wk__btns .mc-wk__b:not(.mc-wk__more) { flex: 1 1 0; }
    .mc-sp__row { flex-direction: column; align-items: flex-start; }
    .mc-sp__row > span { justify-content: flex-start; }
    .mc-sp__new .btn { flex: 1 1 45%; }
    .mc-ye__t td .mc-sub { white-space: normal; }
}
@media (max-width: 767px) {
    .mc-ye__save { bottom: calc(72px + env(safe-area-inset-bottom)); }
    .mc-ye__t, .mc-ye__t tbody { display: block; }
    .mc-ye__t thead { display: none; }
    .mc-ye__t tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
    .mc-ye__t tbody td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; font-size: 13px; }
    .mc-ye__t tbody td:first-child { grid-column: 1 / -1; }
    .mc-ye__t tbody td:nth-child(2)::before { content: 'Opening'; }
    .mc-ye__t tbody td:nth-child(3)::before { content: 'In'; }
    .mc-ye__t tbody td:nth-child(4)::before { content: 'Out'; }
    .mc-ye__t tbody td:nth-child(5)::before { content: 'Closing'; }
    .mc-ye__t tbody td:nth-child(n+2):nth-child(-n+5)::before { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
    .mc-ye__t tbody td:last-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
    .mc-ye__t tbody td:last-child::before { content: 'New opening'; font-size: 12px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
    .mc-ye__t tbody td:last-child .mc-ye__in { flex: 1 1 auto; height: 44px; font-size: 16px; }
    .mc-ye__t tbody td[colspan] { grid-column: 1 / -1; }
    .mc-ye__t tbody td[colspan]::before { display: none !important; }
}
@media (max-width: 767px) {
    body.mc-adminpg .table-responsive table.table tfoot { display: block; margin-top: 10px; }
    body.mc-adminpg .table-responsive table.table tfoot tr { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
    body.mc-adminpg .table-responsive table.table tfoot td:empty { display: none; }
    body.mc-adminpg .table-responsive table.table tfoot td { border: 0 !important; padding: 0 !important; background: transparent !important; }
    .mc-u30 .card > .table-responsive { padding: 10px; }
}
.mc-ph__img--note { aspect-ratio: auto; height: 64px; font-size: 28px; }
@media (max-width: 767px) { .mc-ph__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } }

/* Update 31: overtime, wage slip, plan picker */
.mc-wk__ot { color: var(--brand-700); font-weight: 700; }
.mc-wk__b.mc-wk__more { min-width: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.mc-wk__t td.c.is-N { background: var(--card); }
.mc-wk__slip { white-space: pre-wrap; font: 13.5px/1.55 var(--font, inherit); background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-height: 48vh; overflow-y: auto; color: var(--ink); }
.mc-sp__price span small { display: block; color: var(--brand-700); font-size: 11px; }
.mc-planpick__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-bottom: 10px; }
.mc-planpick__it { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px; text-align: left; }
.mc-planpick__it b { display: block; color: var(--ink); font-size: 13px; }
.mc-planpick__it span { font-size: 12px; color: var(--muted); }
.mc-planpick__it.is-on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
@media (max-width: 767px) { .mc-wk__btns .mc-wk__more { flex: 0 0 64px; } }
@media (max-width: 767px) { .mc-u30 .mc-page-head__actions .btn > span { display: inline !important; } .mc-u30 .mc-page-head__actions .btn { flex: 1 1 0; gap: 6px; } }

/* Update 32: pay wages, statement */
.mc-wk__acts { white-space: nowrap; }
.mc-wk__acts .btn { margin-left: 4px; }
.mc-wk__stbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mc-wk__stbtns .btn { height: 44px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 767px) {
    body.mc-adminpg .table-responsive table.table tbody td.mc-wk__acts { grid-column: 1 / -1; display: flex; gap: 6px; }
    body.mc-adminpg .table-responsive table.table tbody td.mc-wk__acts .btn { flex: 1 1 0; height: 42px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
    .mc-wk__stbtns .btn { flex: 1 1 45%; justify-content: center; }
}
.mc-wk__wname { min-width: 150px; }
@media (min-width: 768px) { .mc-wk__lbl { display: none; } }
@media (max-width: 767px) { .mc-wk__bar .mc-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .mc-wk__bar .mc-tabs::-webkit-scrollbar { display: none; } .mc-wk__bar .mc-tabs button { flex: 0 0 auto; white-space: nowrap; } }
@media (min-width: 768px) { .mc-wk__pay th, .mc-wk__pay td { padding-left: 8px !important; padding-right: 8px !important; } .mc-wk__pay td.mc-wk__acts .btn { padding: 4px 8px; } }
@media (min-width: 768px) { .mc-wk__pay td:not(.mc-wk__acts) { white-space: normal !important; } .mc-wk__pay .mc-sub { white-space: normal; display: block; font-size: 11px; } .mc-wk__pay th { white-space: normal !important; } }
/* =====================================================================
   Update 34: menu categories (accordion), back arrow, recent customers (desktop),
   no Cancel buttons in pop-ups, import page, support attachments, workers list
   ===================================================================== */

/* ---- back arrow between Menu and logo */
.mc-top__back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
    color: var(--ink); font-size: 20px; cursor: pointer; flex: 0 0 auto; padding: 0; }
.mc-top__back:hover { background: var(--soft); border-color: var(--input); }
.mc-top__back[hidden] { display: none !important; }
@media (max-width: 991px) { .mc-top__back { width: 36px; height: 40px; border-color: transparent; } }
@media (max-width: 380px) { .mc-top__back + .mc-brand .mc-brand__text { display: none; } }

/* ---- menu: categories only, one opens at a time */
.mc-nav-flat { margin-top: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.mc-acc { margin-top: 2px; }
.mc-nav-cat { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 10px; border: 0; background: transparent; border-radius: 10px; cursor: pointer;
    color: var(--ink); font-weight: 600; font-size: 14.5px; text-align: left; font-family: inherit; }
.mc-nav-cat > i:first-child { font-size: 19px; width: 22px; text-align: center; color: var(--muted); flex: 0 0 22px; }
.mc-nav-cat > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-nav-cat__n { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 1px 7px; }
.mc-nav-chev { font-size: 18px; color: var(--muted); transition: transform .2s ease; }
.mc-nav-cat:hover { background: var(--soft); }
.mc-nav-cat:focus-visible { outline: 0; box-shadow: inset 0 0 0 1.5px var(--brand-200); }
.mc-acc.is-open > .mc-nav-cat { color: var(--brand-700); }
.mc-acc.is-open > .mc-nav-cat > i:first-child, .mc-acc.is-open > .mc-nav-cat .mc-nav-chev { color: var(--brand); }
.mc-acc.is-open > .mc-nav-cat .mc-nav-chev { transform: rotate(180deg); }
.mc-acc.is-open > .mc-nav-cat .mc-nav-cat__n { display: none; }
.mc-nav-sub { display: none; margin: 0 0 6px 21px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.mc-acc.is-open > .mc-nav-sub, .mc-menu-searching .mc-nav-sub { display: block; animation: mcAccIn .18s ease; }
.mc-nav-sub .mc-nav-item { padding: 8px 10px; font-size: 13.5px; }
.mc-nav-sub .mc-nav-item i { font-size: 17px; }
.mc-menu-searching .mc-nav-cat { pointer-events: none; padding-top: 8px; padding-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.mc-menu-searching .mc-nav-cat > i, .mc-menu-searching .mc-nav-cat__n { display: none; }
@keyframes mcAccIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mc-nav-sub { animation: none !important; } .mc-nav-chev { transition: none; } }

/* ---- customer search on bill screens: never show the old drop-down next to the search box */
.mc-cbx ~ .select2-container, select.mc-cbx-native + .select2-container, .bootstrap-select.mc-cbx-native > .dropdown-toggle { display: none !important; }

/* ---- recently billed customers: compact chips on desktop, at most 2 lines (all of them are also at the top of the search list) */
.mc-cbx__hd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; display: flex; align-items: center; gap: 4px; }
@media (min-width: 992px) {
    .mc-recent { gap: 5px; margin-top: 6px; max-height: 54px; overflow: hidden; }
    .mc-recent > span { font-size: 11.5px; }
    .mc-recent__b { max-width: 150px; padding: 2px 9px; font-size: 12px; line-height: 1.55; background: var(--soft); border-color: transparent; }
    .mc-recent__b:hover { background: var(--brand-50); border-color: var(--brand-200); }
}

/* ---- pop-ups: the X closes, no Cancel button */
.modal-footer .btn-light[data-dismiss="modal"], .modal-footer .btn-secondary[data-dismiss="modal"] { display: none !important; }
.mc-mde__askbox { position: relative; }
.mc-mde__askbox .mc-mde__askx { position: absolute; top: 8px; right: 8px; }
.mc-mde__askbox label { padding-right: 36px; }

/* ---- import from Excel */
.mc-imp { max-width: 1100px; }
.mc-imp__drop { display: block; border: 2px dashed var(--brand-200); background: var(--brand-50); border-radius: 16px; padding: 26px 16px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.mc-imp__drop:hover, .mc-imp__drop.is-over { border-color: var(--brand); background: var(--card); }
.mc-imp__drop i { font-size: 38px; color: var(--brand); display: block; }
.mc-imp__drop b { display: block; font-size: 16px; color: var(--ink); margin-top: 6px; }
.mc-imp__drop small { color: var(--muted); }
.mc-imp__steps { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; }
.mc-imp__steps li { flex: 1 1 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 44px; position: relative; font-size: 13px; color: var(--text); }
.mc-imp__steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.mc-imp__steps b { color: var(--ink); display: block; }
.mc-imp__sum { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mc-imp__sum span { border-radius: 20px; padding: 4px 12px; font-weight: 700; font-size: 13px; background: var(--soft); }
.mc-imp__sum .ok { background: #dcfce7; color: #166534; }
.mc-imp__sum .sk { background: #fef3c7; color: #92400e; }
.mc-imp__sum .er { background: #fee2e2; color: #991b1b; }
.mc-imp__tbl { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.mc-imp__tbl table { width: 100%; font-size: 13px; margin: 0; }
.mc-imp__tbl th { position: sticky; top: 0; background: var(--soft); z-index: 1; white-space: nowrap; padding: 8px 10px; font-weight: 700; }
.mc-imp__tbl td { padding: 6px 10px; border-top: 1px solid var(--line-2); vertical-align: top; }
.mc-imp__tbl tr.is-Error td { background: #fff5f5; }
.mc-imp__tbl tr.is-Skipped td { background: #fffbeb; }
.mc-imp__st { font-weight: 700; font-size: 12px; white-space: nowrap; }
.mc-imp__st.Added, .mc-imp__st.Ready { color: #15803d; }
.mc-imp__st.Skipped { color: #b45309; }
.mc-imp__st.Error { color: #b91c1c; }
.mc-imp__bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.mc-imp__map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin: 12px 0; }
.mc-imp__map label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 2px; display: block; }
.mc-imp__map label em { color: var(--red); font-style: normal; }

/* ---- support attachments */
.mc-att { margin-top: 8px; }
.mc-att__pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand-700); cursor: pointer; border: 1px dashed var(--brand-200); border-radius: 10px; padding: 6px 12px; background: var(--brand-50); }
.mc-att__pick input { display: none; }
.mc-att__list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mc-att__f { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px 4px 4px; background: var(--card); font-size: 12px; max-width: 220px; color: var(--text) !important; text-decoration: none !important; }
.mc-att__f img { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; background: var(--soft); }
.mc-att__f .ic { width: 40px; height: 40px; border-radius: 7px; background: #fee2e2; color: #b91c1c; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 40px; }
.mc-att__f span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-att__f button { border: 0; background: transparent; color: var(--muted); padding: 0 2px; font-size: 16px; cursor: pointer; }
.mc-att__f:hover { border-color: var(--brand-200); }
.mc-att__hint { font-size: 11.5px; color: var(--muted); margin-left: 6px; }

/* ---- workers list (add / edit / delete) */
.mc-wl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mc-wl__c { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.mc-wl__c.is-off { opacity: .65; }
.mc-wl__h { display: flex; align-items: center; gap: 10px; }
.mc-wl__av { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 40px; }
.mc-wl__h b { color: var(--ink); font-size: 15px; display: block; }
.mc-wl__h small { color: var(--muted); font-size: 12px; }
.mc-wl__m { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text); }
.mc-wl__m span b { color: var(--ink); }
.mc-wl__a { display: flex; gap: 6px; margin-top: 4px; }
.mc-wl__a .btn { flex: 1 1 auto; }
/* =====================================================================
   Update 36: payment status chips, undo bar, last rate, keyboard hints, bill bar,
   swipe to delete an item, sparklines, slabs, delivery, measurement, cash book,
   staff sales, backups, dark mode (real colours instead of the old invert filter)
   ===================================================================== */

/* ---- UI 7: one payment status everywhere */
.mc-pst { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; white-space: nowrap; line-height: 1.6; vertical-align: middle; }
.mc-pst--paid { background: var(--green-50); color: #17784f; }
.mc-pst--partly { background: var(--amber-50); color: #96620a; }
.mc-pst--due { background: var(--red-50); color: #b63a3a; }
.mc-pst--overdue { background: #b63a3a; color: #fff; }
.mc-pst--none { display: none; }
.mc-list__main b .mc-pst { margin-left: 6px; }

/* ---- UI 8: "Deleted - Undo" */
.mc-undo { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); z-index: 100001; display: flex; align-items: center; gap: 12px;
    background: #0f2a36; color: #fff; border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 14px 34px rgba(0, 0, 0, .28); min-width: 280px; max-width: calc(100vw - 24px);
    transition: transform .22s ease; overflow: hidden; }
.mc-undo.show { transform: translate(-50%, 0); }
.mc-undo i { font-size: 18px; opacity: .8; }
.mc-undo span { flex: 1 1 auto; font-weight: 600; font-size: 14px; }
.mc-undo button { border: 0; background: var(--brand); color: #fff; font-weight: 800; border-radius: 10px; padding: 8px 16px; cursor: pointer; font-family: inherit; }
.mc-undo em { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); width: 100%; animation: mcUndo 5s linear forwards; }
@keyframes mcUndo { from { width: 100%; } to { width: 0; } }
@media (max-width: 991px) { .mc-undo { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.mc-undo-hide { display: none !important; }

/* ---- 2. last rate under the Rate box */
.mc-lr { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mc-lr[hidden] { display: none; }
.mc-lr__b { border: 1px solid var(--line); background: var(--soft); color: var(--text); border-radius: 20px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.mc-lr__b b { color: var(--ink); }
.mc-lr__b small { color: var(--muted); }
.mc-lr__b.is-main { background: var(--brand-50); border-color: var(--brand-200); }
.mc-lr__b.is-group { background: var(--violet-50); border-color: transparent; }
.mc-lr__b:hover { border-color: var(--brand); }
.mc-lr__cost { font-size: 11.5px; color: var(--muted); padding: 2px 4px; white-space: nowrap; }

/* ---- UI 2 / 3: sticky bill bar - items, taxable, GST, keyboard */
.mc-doc-more { display: none; gap: 18px; align-items: center; margin-left: auto; }
.mc-doc-more span { display: flex; flex-direction: column; line-height: 1.15; }
.mc-doc-more small { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.mc-doc-more b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-doc-more + .mc-doc-total { margin-left: 18px !important; }
.mc-kbd-hint { display: none; font-size: 11.5px; color: var(--muted); }
.mc-kbd-hint kbd { background: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--ink); font-size: 10.5px; padding: 0 5px; font-family: inherit; box-shadow: none; }
@media (min-width: 992px) { .mc-doc-more { display: flex; } }
@media (min-width: 1280px) { .mc-kbd-hint { display: inline; } }

/* ---- UI 6: swipe left on an item (phone) */
@media (max-width: 767px) {
    #tblProducts tbody tr { transition: transform .18s ease; position: relative; }
    #tblProducts tbody td:not(.mc-td-act) .btn, #tblProducts tbody td:not(.mc-td-act) button { min-height: 44px; min-width: 44px; }
    /* Update 39: delete button of an item card - 40 px, in the corner, never over the text */
    #tblProducts tbody td.mc-td-act { top: 10px !important; right: 10px !important; padding: 0 !important; border: 0 !important; width: auto !important; }
    #tblProducts tbody td.mc-td-act .btn { width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
    #tblProducts tbody td.mc-td-act .btn i { margin: 0 !important; }
    #tblProducts tbody tr::after { right: 60px !important; top: 22px !important; }
    #tblProducts tbody td.mc-td-name { padding-right: 140px !important; min-height: 42px; display: flex !important; align-items: center; }
    #tblProducts tbody tr.mc-sw-on { z-index: 2; }
    .mc-sw-del { position: absolute; top: 0; bottom: 0; right: -96px; width: 90px; border: 0; border-radius: 12px; background: var(--red); color: #fff; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: inherit; }
    .mc-sw-del i { font-size: 20px; }
}

/* ---- UI 1: sparklines in the dashboard cards */
.mc-kpi__spark { position: absolute; right: 14px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; pointer-events: none; }
.mc-kpi__spark small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.mc-spark .l { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mc-spark .a { fill: var(--brand); opacity: .12; stroke: none; }
.mc-spark circle { fill: var(--brand); }
.mc-kpi--green .mc-spark .l, .mc-kpi--green .mc-spark circle { stroke: var(--green); fill: var(--green); } .mc-kpi--green .mc-spark .l { fill: none; } .mc-kpi--green .mc-spark .a { fill: var(--green); }
.mc-kpi--orange .mc-spark .l, .mc-kpi--orange .mc-spark circle { stroke: var(--accent); fill: var(--accent); } .mc-kpi--orange .mc-spark .l { fill: none; } .mc-kpi--orange .mc-spark .a { fill: var(--accent); }
@media (max-width: 575px) { .mc-kpi__spark { position: static; align-items: flex-start; margin-top: 6px; } }

/* ---- 3. slabs */
.mc-slabno { display: inline-flex; align-items: center; gap: 8px; }
.mc-slab-th { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; cursor: zoom-in; background: var(--soft); flex: 0 0 38px; }
.mc-slabpic img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: var(--soft); }
.mc-slabpic__none { height: 160px; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-weight: 700; }
.mc-slabbox { margin-bottom: 12px; }
.mc-slabbox__in { display: flex; gap: 14px; align-items: center; }
.mc-slabbox__in img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
.mc-slabbox__none { width: 96px; height: 96px; border-radius: 12px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--faint); flex: 0 0 96px; }
.mc-slabbox__in b { display: block; color: var(--ink); font-size: 16px; }
.mc-slabbox__in small { color: var(--muted); }
.mc-qpick { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; padding: 4px; }
.mc-qpick__it { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; font-family: inherit; color: var(--text); margin: 0; }
.mc-qpick__it b { color: var(--ink); }
.mc-qpick__it small { display: block; color: var(--muted); font-size: 12px; }
.mc-qpick__it:hover { background: var(--soft); }
.mc-qpick__it.is-on { background: var(--brand-50); box-shadow: inset 0 0 0 1.5px var(--brand-200); }

/* ---- 6. delivery buttons on the challans */
.mc-ch-row { display: block; }
.mc-ch-row__link { display: block; color: inherit !important; text-decoration: none !important; }
.mc-ch-row__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* ---- 5. site measurement */
.mc-ms__tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.mc-ms__tbl table { min-width: 720px; }
.mc-ms__tbl td { padding: 6px; vertical-align: middle; }
.mc-ms__tbl .form-control { height: 38px; padding: 4px 8px; }
.mc-fi { display: flex; gap: 4px; }
.mc-fi .form-control { width: 64px; }
.mc-ms__sum { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.mc-ms__sum span { background: var(--soft); border-radius: 12px; padding: 8px 14px; color: var(--muted); font-size: 13px; }
.mc-ms__sum b { color: var(--ink); font-size: 16px; }
.mc-ms__sum .is-main { background: var(--brand-50); color: var(--brand-700); }
.mc-from-measure { margin: 0 0 8px; }

/* ---- 7. cash book / 9. staff sales */
.mc-wk__month .form-control-sm { width: 150px; height: 32px; }
.mc-cb__k .mc-mini small + small { display: block; font-size: 11px; color: var(--muted); }
.mc-mini--red i { background: var(--red-50); color: var(--red); }
.mc-ss__bar { height: 8px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.mc-ss__bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.mc-ss__bar span.is-ok { background: var(--green); }
.mc-wl__h .ml-auto { margin-left: auto; color: var(--ink); font-size: 16px; }

/* =====================================================================
   UI 5: dark mode - real dark colours (Settings menu > Dark mode)
   ===================================================================== */
html.mc-dark {
    color-scheme: dark;
    --ink: #e7f1f5; --text: #c6d6dd; --muted: #8fa6b0; --faint: #6c8590;
    --line: #23394a; --line-2: #1d3141; --input: #2c4558; --soft: #172b38; --bg: #0c1a23; --card: #12232f;
    --brand-50: #10313f; --brand-100: #13404f; --brand-200: #1d5568; --brand-700: #7fd4f2;
    --accent-50: #3a2418; --green-50: #12352a; --amber-50: #3a2d10; --red-50: #3c1c1f; --violet-50: #241f44; --teal-50: #0f3330;
    --sh-2: 0 8px 20px rgba(0, 0, 0, .35); --sh-3: 0 14px 34px rgba(0, 0, 0, .5);
}
html.mc-dark body, html.mc-dark .mc-main, html.mc-dark .content-page, html.mc-dark .wrapper { background: var(--bg) !important; color: var(--text); }
html.mc-dark .mc-top { background: rgba(14, 30, 40, .94); border-color: var(--line); }
html.mc-dark .card, html.mc-dark .modal-content, html.mc-dark .dropdown-menu, html.mc-dark .popover, html.mc-dark .list-group-item, html.mc-dark .mc-drawer, html.mc-dark .mc-bottom-nav,
html.mc-dark .bg-white, html.mc-dark .bg-light, html.mc-dark .mc-lv__card, html.mc-dark .mc-sec, html.mc-dark .mc-doc2__bar, html.mc-dark .mc-savebar, html.mc-dark .select2-dropdown,
html.mc-dark .mc-search__panel, html.mc-dark .geo-confirm, html.mc-dark .mc-cbx__list, html.mc-dark .bootstrap-select .dropdown-menu, html.mc-dark .card-header, html.mc-dark .card-footer,
html.mc-dark .modal-header, html.mc-dark .modal-footer, html.mc-dark .mc-md-empty, html.mc-dark .table-responsive { background-color: var(--card) !important; color: var(--text); border-color: var(--line) !important; }
html.mc-dark .form-control, html.mc-dark .custom-select, html.mc-dark .select2-container--default .select2-selection--single, html.mc-dark .select2-container--default .select2-selection--multiple,
html.mc-dark .select2-search__field, html.mc-dark .bootstrap-select > .dropdown-toggle, html.mc-dark .input-group-text, html.mc-dark textarea, html.mc-dark input[type=search], html.mc-dark .mc-drawer__search input {
    background-color: var(--soft) !important; color: var(--ink) !important; border-color: var(--input) !important; }
html.mc-dark .form-control:disabled, html.mc-dark .form-control[readonly] { background-color: #0f202b !important; color: var(--muted) !important; }
html.mc-dark .form-control::placeholder { color: var(--faint); }
html.mc-dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ink) !important; }
html.mc-dark .select2-results__option { color: var(--text); }
html.mc-dark .select2-container--default .select2-results__option--highlighted[aria-selected], html.mc-dark .dropdown-item:hover, html.mc-dark .dropdown-item:focus { background: var(--brand-50) !important; color: var(--ink) !important; }
html.mc-dark .dropdown-item, html.mc-dark .close, html.mc-dark .modal-title, html.mc-dark label, html.mc-dark .card-title, html.mc-dark th { color: var(--ink) !important; }
html.mc-dark .table, html.mc-dark table { color: var(--text); }
html.mc-dark .table td, html.mc-dark .table th, html.mc-dark .table thead th, html.mc-dark td, html.mc-dark th { border-color: var(--line) !important; }
html.mc-dark .table thead th, html.mc-dark .mc-lv__table thead th, html.mc-dark .table-light, html.mc-dark .thead-light th { background: var(--soft) !important; }
html.mc-dark .table-striped tbody tr:nth-of-type(odd), html.mc-dark .table-hover tbody tr:hover, html.mc-dark tr.is-click:hover td { background: rgba(255, 255, 255, .03) !important; }
html.mc-dark .btn-light, html.mc-dark .btn-outline-secondary, html.mc-dark .btn-secondary, html.mc-dark .mc-hdr-btn, html.mc-dark .mc-top__menu, html.mc-dark .mc-top__back, html.mc-dark .mc-fy-chip {
    background-color: var(--soft) !important; color: var(--ink) !important; border-color: var(--line) !important; }
html.mc-dark .btn-light:hover, html.mc-dark .mc-hdr-btn:hover { background-color: var(--brand-50) !important; }
html.mc-dark .text-dark, html.mc-dark .text-body, html.mc-dark h1, html.mc-dark h2, html.mc-dark h3, html.mc-dark h4, html.mc-dark h5, html.mc-dark h6 { color: var(--ink) !important; }
html.mc-dark .text-muted, html.mc-dark small.text-muted { color: var(--muted) !important; }
html.mc-dark .border, html.mc-dark .border-top, html.mc-dark .border-bottom, html.mc-dark hr { border-color: var(--line) !important; }
html.mc-dark .modal-backdrop.show { opacity: .7; }
html.mc-dark .mc-chip { background: var(--soft); color: var(--text); }
html.mc-dark .mc-chip--ok, html.mc-dark .mc-chip--green { background: var(--green-50); color: #6fd7a6; }
html.mc-dark .mc-chip--amber, html.mc-dark .mc-chip--warn, html.mc-dark .mc-chip--orange { background: var(--amber-50); color: #f2c46d; }
html.mc-dark .mc-chip--bad, html.mc-dark .mc-chip--red { background: var(--red-50); color: #ff9c9c; }
html.mc-dark .mc-chip--violet { background: var(--violet-50); color: #b6acff; }
html.mc-dark .mc-pst--paid { color: #6fd7a6; } html.mc-dark .mc-pst--partly { color: #f2c46d; } html.mc-dark .mc-pst--due { color: #ff9c9c; }
html.mc-dark .mc-nav-item.active { background: var(--brand-50); color: var(--brand-700) !important; }
html.mc-dark .mc-ye__last { background: var(--soft); color: var(--text); border-color: var(--line); }
html.mc-dark .mc-ye__last--warn { background: var(--amber-50); }
html.mc-dark .apexcharts-text, html.mc-dark .apexcharts-legend-text { fill: var(--muted) !important; color: var(--muted) !important; }
html.mc-dark .apexcharts-gridline { stroke: var(--line); }
html.mc-dark .apexcharts-tooltip { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; }
html.mc-dark .geo-toast { background: var(--card); color: var(--text); border-color: var(--line); }
html.mc-dark .geo-confirm__title { color: var(--ink); } html.mc-dark .geo-confirm__message { color: var(--muted); }
html.mc-dark .geo-confirm-backdrop { background: rgba(0, 0, 0, .6); }
html.mc-dark .mc-kpi, html.mc-dark .mc-mini, html.mc-dark .mc-stat, html.mc-dark .mc-action, html.mc-dark .mc-wl__c, html.mc-dark .mc-jb-card, html.mc-dark .mc-card-row, html.mc-dark .mc-sp__row,
html.mc-dark .mc-imp__steps li, html.mc-dark .mc-att__f, html.mc-dark .mc-recent__b { background-color: var(--card); border-color: var(--line); color: var(--text); }
html.mc-dark .mc-mde__paper canvas, html.mc-dark .mc-tpl-card__pic, html.mc-dark img.mc-sign, html.mc-dark .mc-sp__qr, html.mc-dark .pad canvas { background: #fff; }
html.mc-dark mark { background: #6b5b12; color: #fff; }
@media print {
    html.mc-dark { --ink: #0f3d4f; --text: #24414d; --muted: #6b8490; --line: #e3edf1; --soft: #f8fbfc; --bg: #fff; --card: #fff; color-scheme: light; }
    html.mc-dark body, html.mc-dark .card, html.mc-dark .table td, html.mc-dark .table th { background: #fff !important; color: #000 !important; }
}

/* Update 37: row "more actions" menu - placed inside the screen by mc-list.js (fixed, flips up, scrolls) */
.mc-lv .dropdown-menu.show, .mc-acts .dropdown-menu.show, .mc-card-row .dropdown-menu.show { z-index: 1065; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mc-lv .dropdown-menu .dropdown-item, .mc-acts .dropdown-menu .dropdown-item { white-space: nowrap; }
@media (max-width: 767px) { .mc-lv .dropdown-menu.show .dropdown-item { padding-top: 10px; padding-bottom: 10px; } }

/* Update 38: row actions open in the centre of the screen (desktop and phone) */
.mc-asheet { position: fixed; inset: 0; z-index: 100000; background: rgba(9, 28, 38, .45); display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; transition: opacity .16s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.mc-asheet.show { opacity: 1; }
.mc-asheet__box { background: var(--card); width: 100%; max-width: 380px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
    border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); transform: scale(.96); transition: transform .16s ease; overflow: hidden; }
.mc-asheet.show .mc-asheet__box { transform: none; }
.mc-asheet__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line-2); }
.mc-asheet__head b { flex: 1 1 auto; min-width: 0; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-asheet__x { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mc-asheet__x:hover { background: var(--soft); color: var(--ink); }
.mc-asheet__list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mc-asheet__it { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 12px 14px; min-height: 48px;
    font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; }
.mc-asheet__it i { font-size: 19px; width: 22px; text-align: center; color: var(--brand); flex: 0 0 22px; margin: 0 !important; }
.mc-asheet__it:hover, .mc-asheet__it:focus-visible { background: var(--brand-50); color: var(--ink); outline: 0; }
.mc-asheet__it.is-danger, .mc-asheet__it.is-danger i { color: var(--red); }
.mc-asheet__it.is-danger:hover { background: var(--red-50); }
.mc-asheet__it.is-off { opacity: .45; cursor: default; }
.mc-asheet__sep { height: 1px; background: var(--line-2); margin: 4px 10px; }
@media (prefers-reduced-motion: reduce) { .mc-asheet, .mc-asheet__box { transition: none; } }

/* Update 39: rate suggestions centred on phones (same as "Used most") */
@media (max-width: 767px) { .mc-lr { justify-content: center; } .mc-lr__cost { width: 100%; text-align: center; } }
.mc-from-measure[hidden] { display: none !important; }

/* =====================================================================
   Update 40: offcuts, cutting plan, quotation board, price list, vehicles & trips,
   margins, slow stock, Smart Insights
   ===================================================================== */
.mc-u39 .mc-wk__bar { flex-wrap: wrap; gap: 8px; }
.mc-u39-sel { width: auto; min-width: 180px; max-width: 100%; }
.mc-u39-days { width: 76px; display: inline-block; }
.mc-u39-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mc-u39-chk input { width: 16px; height: 16px; }
.mc-u39-acts { white-space: nowrap; }
.mc-u39-acts .btn + .btn { margin-left: 4px; }
.mc-u39 .mc-mini small + small { display: block; }
.mc-u39-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; margin-left: 6px; }
.mc-u39-bar i { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.mc-u39-bar.is-neg i { background: var(--red); }
.mc-u39 th a { color: inherit; text-decoration: none; }
.mc-u39 th a.is-on { color: var(--brand-700); }
#mcPageActs .mc-u39-days { height: 32px; }

/* ---- offcut hint on the quotation add item box */
.mc-oc-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--teal-50); color: var(--teal); font-size: 12.5px; flex-basis: 100%; width: 100%; }
.mc-oc-hint[hidden] { display: none; }
.mc-oc-hint i { font-size: 16px; }
.mc-oc-hint span { flex: 1 1 200px; color: var(--text); }
.mc-oc-hint small { color: var(--muted); }

/* ---- cutting plan */
.mc-cp__pcs { display: flex; flex-direction: column; gap: 6px; }
.mc-cp__row { display: flex; align-items: center; gap: 4px; }
.mc-cp__row input { min-width: 0; flex: 1 1 60px; }
.mc-cp__row .mc-cp__n { flex: 0 0 56px; }
.mc-cp__row span { color: var(--muted); }
.mc-cp__card .card-header { flex-wrap: wrap; gap: 6px; }
.mc-cp__svg { width: 100%; height: auto; display: block; }
.mc-cp__bin { fill: var(--soft); stroke: var(--ink); stroke-width: 1.5; }
.mc-cp__pc { stroke: #fff; stroke-width: 1.5; }
.mc-cp__pc--0 { fill: #8fd3ee; } .mc-cp__pc--1 { fill: #b6e3c8; } .mc-cp__pc--2 { fill: #f7d58b; }
.mc-cp__pc--3 { fill: #c9c2f2; } .mc-cp__pc--4 { fill: #f4b8b8; } .mc-cp__pc--5 { fill: #a7e0d8; }
.mc-cp__svg text { fill: #1d2433; font-weight: 700; font-family: inherit; }
@media print {
    .mc-u39 .col-lg-4, .mc-u39 .mc-minis { display: none !important; }
    .mc-u39 .col-lg-8 { flex: 0 0 100%; max-width: 100%; }
    .mc-cp__card { break-inside: avoid; }
}

/* ---- quotation board */
.mc-qb { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mc-qb__c { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mc-qb__h { display: flex; justify-content: space-between; gap: 10px; }
.mc-qb__h small { color: var(--muted); }
.mc-qb__amt { white-space: nowrap; color: var(--ink); }
.mc-qb__m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-qb__a { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-qb__a .btn { flex: 1 1 auto; }
.mc-u39 .mc-tabs button b { margin-left: 4px; font-weight: 800; opacity: .75; }

/* ---- price list */
.mc-pl__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mc-pl__head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.mc-pl__head span { display: block; color: var(--muted); font-size: 12.5px; }

/* ---- vehicles list (pop-up) */
.mc-u39-vl { display: flex; flex-direction: column; gap: 6px; }
.mc-u39-vl__r { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-family: inherit; }
.mc-u39-vl__r span { color: var(--muted); font-size: 12.5px; }
.mc-u39-vl__r.is-off { opacity: .6; }
.mc-u39-vl__r:hover { border-color: var(--brand); }

/* ---- Smart Insights */
.mc-in__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mc-in__card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); color: var(--text); text-decoration: none !important; }
.mc-in__card > i { font-size: 22px; line-height: 1; margin-top: 2px; color: var(--brand); }
.mc-in__card b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 3px; }
.mc-in__card p { margin: 0; font-size: 12.8px; color: var(--muted); line-height: 1.45; }
a.mc-in__card:hover { box-shadow: 0 8px 22px rgba(15, 42, 54, .08); }
.mc-in__card--bad { border-left-color: var(--red); } .mc-in__card--bad > i { color: var(--red); }
.mc-in__card--warn { border-left-color: var(--amber); } .mc-in__card--warn > i { color: var(--amber); }
.mc-in__card--good { border-left-color: var(--green); } .mc-in__card--good > i { color: var(--green); }
.mc-in__card--info { border-left-color: var(--violet); } .mc-in__card--info > i { color: var(--violet); }
.mc-in__nav { position: sticky; top: 60px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin-bottom: 6px; background: var(--bg, transparent); scrollbar-width: none; }
.mc-in__nav::-webkit-scrollbar { display: none; }
.mc-in__nav a { flex: 0 0 auto; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.mc-in__nav a:hover { border-color: var(--brand); color: var(--brand-700); }
.mc-in__sec { margin-top: 18px; scroll-margin-top: 110px; }
.mc-in__sec .mc-br__h small { font-weight: 600; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.mc-in__chart { width: 100%; height: auto; display: block; }
.mc-in__b { fill: var(--brand); opacity: .85; }
.mc-in__b.is-pace { fill: var(--brand); opacity: .22; }
.mc-in__b.is-est { fill: none; stroke: var(--violet); stroke-width: 2; stroke-dasharray: 5 4; opacity: 1; }
.mc-in__t { fill: var(--muted); font-size: 11px; font-family: inherit; }
.mc-in__sug { color: var(--green); font-size: 14px; }
.mc-in__risk { display: inline-block; vertical-align: middle; width: 60px; height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; margin-right: 6px; }
.mc-in__risk i { display: block; height: 100%; border-radius: 6px; }
.mc-in__risk--h i { background: var(--red); } .mc-in__risk--m i { background: var(--amber); } .mc-in__risk--l i { background: var(--green); }
.mc-in__segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.mc-in__seg { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-family: inherit; }
.mc-in__seg i { grid-row: 1 / 4; font-size: 20px; color: var(--brand); }
.mc-in__seg b { font-size: 18px; color: var(--ink); line-height: 1.1; }
.mc-in__seg span { font-size: 12.5px; font-weight: 700; }
.mc-in__seg small { font-size: 11.5px; color: var(--muted); }
.mc-in__seg.is-on { border-color: var(--brand); background: var(--brand-50); }
@media (max-width: 767px) {
    .mc-in__cards { grid-template-columns: 1fr; }
    .mc-in__nav { top: 56px; }
    .mc-qb { grid-template-columns: 1fr; }
    .mc-pl__head { flex-direction: column; align-items: flex-start; }
    .mc-u39-sel { min-width: 0; flex: 1 1 100%; }
}

/* ---- delivery challan list: more buttons */
.mc-ch-row__acts a.btn { text-decoration: none; }
/* chips keep their colour on the Update 40 pages (a later .mc-chip rule painted them all blue) */
.mc-u39 .mc-chip--ok, .mc-u39 .mc-chip--green { background: var(--green-50); color: var(--green); }
.mc-u39 .mc-chip--bad, .mc-u39 .mc-chip--red { background: var(--red-50); color: var(--red); }
.mc-u39 .mc-chip--warn, .mc-u39 .mc-chip--amber { background: var(--amber-50); color: var(--amber); }
.mc-u39 .mc-chip--violet { background: var(--violet-50); color: var(--violet); }
.mc-u39 .mc-chip--teal { background: var(--teal-50); color: var(--teal); }
.mc-u39 .mc-chip--grey { background: var(--soft); color: var(--muted); }
html.mc-dark .mc-u39 .mc-chip--ok, html.mc-dark .mc-u39 .mc-chip--green { color: #6fd7a6; }
html.mc-dark .mc-u39 .mc-chip--bad, html.mc-dark .mc-u39 .mc-chip--red { color: #ff9c9c; }
html.mc-dark .mc-u39 .mc-chip--warn, html.mc-dark .mc-u39 .mc-chip--amber { color: #f2c46d; }
.mc-cp__body { overflow: hidden; }
@media (max-width: 991px) { .mc-u39 #mcPage > .row { margin-left: 0; margin-right: 0; } .mc-u39 #mcPage > .row > [class*=col-] { padding-left: 0; padding-right: 0; } }
/* ---- Update 41: Database Check */
.mc-dbc { padding: 4px 16px; }
.mc-dbk { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mc-dbk:last-child { border-bottom: 0; }
.mc-dbk > span { color: var(--muted); font-weight: 700; }
.mc-dbk > div { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.mc-dbk small { display: block; color: var(--muted); margin-top: 3px; }
.mc-dbk .mc-chip { white-space: normal; margin: 2px 4px 2px 0; }
.mc-dbk code { overflow-wrap: anywhere; }
@media (max-width: 575px) { .mc-dbk { grid-template-columns: 1fr; gap: 3px; } }

/* ---- Update 44: phone bars stay at the screen edges (iPhone keyboard / zoom shift is corrected in mcalc-app.js) */
@media (max-width: 991px) {
    html.mc-typing .mc-bottom-nav { display: none; }                     /* while typing the keyboard is there - no bar floating above it */
    html.mc-typing .mc-toasts { bottom: 12px; }
    /* 16px text in boxes: iPhone does not zoom the page in when a box is tapped (the zoom left the bars in the middle) */
    input.form-control, select.form-control, textarea.form-control, .mc-search input, .select2-search__field, .dataTables_filter input { font-size: 16px !important; }
    .form-control-sm { font-size: 16px !important; }
}
/* rows were 3px wider than the phone screen (row -15px, page padding 12px): the page could slide sideways */
@media (max-width: 991px) {
    .mc-main .row { margin-left: -12px; margin-right: -12px; }
    .mc-main .row > [class*="col-"], .mc-main .row > .col { padding-left: 12px; padding-right: 12px; }
}

/* =====================================================================
   Update 45: My shortcuts (menu), architects & masons, fittings, blocks, breakage,
   cheques, bank statement match, enquiries, quotation versions, purchase orders,
   business rules + helpers on the bill screens
   ===================================================================== */

/* ---- My shortcuts: pin button on every menu item */
.mc-nav-item { position: relative; }
.mc-nav-item .mc-pin { flex: 0 0 28px; width: 28px; height: 28px; margin: -4px -4px -4px 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.mc-nav-item .mc-pin i { font-size: 15px; width: auto; flex: 0 0 auto; color: inherit !important; }
.mc-nav-item:hover .mc-pin, .mc-nav-item.is-focus .mc-pin, .mc-nav-item .mc-pin:focus-visible, .mc-nav-item.is-pinned .mc-pin { opacity: 1; }
.mc-nav-item .mc-pin:hover { background: var(--brand-50); color: var(--brand-700); }
.mc-nav-item.is-pinned .mc-pin { color: var(--brand); }
.mc-nav-item.active .mc-pin { color: inherit; }
.mc-nav-item.active .mc-pin:hover { background: rgba(255, 255, 255, .22); }
@media (hover: none) {
    .mc-nav-item .mc-pin { opacity: .4; }
    .mc-nav-item.is-pinned .mc-pin { opacity: 1; }
}
.mc-pins { margin: 2px 0 8px; padding: 6px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.mc-pins[hidden], .mc-pins.mc-hide, .mc-menu-searching .mc-pins { display: none; }
.mc-pins__h { display: flex; align-items: center; gap: 6px; padding: 2px 6px 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-700); }
.mc-pins__h i { font-size: 14px; }
.mc-pins__h em { margin-left: auto; font-style: normal; font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; }
.mc-pins .mc-nav-item { padding: 7px 8px; font-size: 13.5px; background: transparent; }
.mc-pins .mc-nav-item:hover { background: rgba(255, 255, 255, .7); }
.mc-pins .mc-nav-item.active { background: var(--brand); color: #fff !important; box-shadow: none; }
.mc-pins .mc-nav-item.active i { color: #fff; }
.mc-pins .mc-nav-item i { font-size: 17px; }
.mc-pins__x { flex: 0 0 26px; width: 26px; height: 26px; margin: -4px -4px -4px 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.mc-pins__x i { font-size: 15px !important; width: auto !important; flex: 0 0 auto !important; color: inherit !important; }
.mc-pins__x:hover { background: #fde8e8; color: var(--red); }
.mc-pins .mc-nav-item.active .mc-pins__x { color: inherit; }
html.mc-dark .mc-pins { background: rgba(50, 189, 234, .08); border-color: rgba(50, 189, 234, .2); }
html.mc-dark .mc-pins .mc-nav-item:hover { background: rgba(255, 255, 255, .06); }

/* ---- shared */
.mc-u45 .mc-wk__bar { flex-wrap: wrap; gap: 8px; }
.mc-u45 .mc-tabs b { font-weight: 800; opacity: .75; margin-left: 2px; }
.mc-u45-off td:not(:last-child) { opacity: .55; }
.mc-u45-range { display: flex; align-items: center; gap: 6px; }
.mc-u45-range input { width: 150px; }
.mc-u45-range span { color: var(--muted); font-size: 13px; }
.mc-u45-sticky { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 20px rgba(15, 42, 61, .06); }
@media (max-width: 767px) { .mc-u45-sticky { bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* party finder */
.mc-u45-party { position: relative; }
.mc-u45-party__list { position: absolute; left: 5px; right: 5px; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 30px rgba(15, 42, 61, .14); max-height: 260px; overflow: auto; }
.mc-u45-party__list[hidden] { display: none; }
.mc-u45-party__list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.mc-u45-party__list button:hover { background: var(--soft); }
.mc-u45-party__list b { display: block; color: var(--ink); font-size: 14px; }
.mc-u45-party__list small { color: var(--muted); }
.mc-u45-party__none { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* ---- fitting schedule + enquiry cards */
.mc-u45-fl, .mc-u45-leads { display: flex; flex-direction: column; gap: 10px; }
.mc-u45-leads { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.mc-u45-fl__d { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 6px 2px -2px; }
.mc-u45-fl__d.is-today { color: var(--brand-700); }
.mc-u45-fc, .mc-u45-lc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mc-u45-fc__h, .mc-u45-lc__h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mc-u45-fc__h b, .mc-u45-lc__h b { color: var(--ink); font-size: 15px; }
.mc-u45-fc__h small, .mc-u45-lc__h small { color: var(--muted); }
.mc-u45-fc .mc-sub i { color: var(--muted); }
.mc-u45-fc__a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mc-u45-lc__n { margin-top: 6px; color: var(--text); font-size: 13.5px; }
.mc-u45-st { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mc-u45-st label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; margin: 0; }
.mc-u45-st label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }

/* photos */
.mc-u45-ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.mc-u45-ph__i { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); }
.mc-u45-ph__i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-u45-ph__i button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15, 42, 61, .7); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }

/* bank statement */
.mc-u45-nar { display: block; max-width: 420px; white-space: normal; word-break: break-word; font-size: 13px; }

/* quotation versions */
.mc-u45-vl { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mc-u45-vl__i { flex: 0 0 auto; min-width: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card); display: flex; flex-direction: column; }
.mc-u45-vl__i.is-on { border-color: var(--brand); background: var(--brand-50); }
.mc-u45-vl__i b { color: var(--ink); font-size: 16px; }
.mc-u45-vl__i small { color: var(--muted); font-size: 11.5px; }
tr.mc-u45-add td { background: #f0faf4; }
tr.mc-u45-delr td { background: #fdf2f2; text-decoration: line-through; text-decoration-color: rgba(182, 58, 58, .4); }
html.mc-dark tr.mc-u45-add td { background: rgba(31, 157, 107, .1); }
html.mc-dark tr.mc-u45-delr td { background: rgba(220, 75, 75, .1); }

/* purchase orders */
.mc-u45-pol .form-group { margin-bottom: 6px; }
.mc-u45-qin { width: 90px; display: inline-block; text-align: right; }

/* business rules */
.mc-u45-sw { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; margin: 0; }
.mc-u45-sw:last-child { border-bottom: 0; }
.mc-u45-sw input { width: 40px; height: 22px; flex: 0 0 40px; appearance: none; -webkit-appearance: none; border-radius: 22px; background: var(--input); position: relative; cursor: pointer; transition: background .15s; margin-top: 2px; }
.mc-u45-sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .15s; }
.mc-u45-sw input:checked { background: var(--brand); }
.mc-u45-sw input:checked::after { left: 21px; }
.mc-u45-sw input:focus-visible { outline: 2px solid var(--brand-200); outline-offset: 2px; }
.mc-u45-sw b { display: block; color: var(--ink); font-size: 14px; }
.mc-u45-sw small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ---- bill screens: architect / mason, credit block, advance */
.mc-u45-billbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: -4px 0 10px; }
.mc-u45-billbar:empty { display: none; }
.mc-u45-ref { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.mc-u45-ref label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.mc-u45-ref label i { color: var(--violet, #7c5cd6); }
.mc-u45-ref select { width: auto; min-width: 200px; max-width: 100%; }
.mc-u45-credit { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fdeeee; color: #a63232; font-size: 13px; }
.mc-u45-credit i { font-size: 18px; }
.mc-u45-adv { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: #eaf7f0; color: #17784f; }
.mc-u45-adv > i { font-size: 18px; }
.mc-u45-adv span { display: flex; flex-direction: column; line-height: 1.25; margin-right: 4px; }
.mc-u45-adv small { color: var(--muted); font-size: 11.5px; }
html.mc-dark .mc-u45-credit { background: rgba(220, 75, 75, .14); color: #f19c9c; }
html.mc-dark .mc-u45-adv { background: rgba(31, 157, 107, .14); color: #7fd6ac; }
.mc-u45-srb { margin-left: 4px; }
@media (max-width: 575px) {
    .mc-u45-ref { flex: 1 1 100%; } .mc-u45-ref select { flex: 1 1 auto; min-width: 0; width: 100%; }
    .mc-u45-adv { flex: 1 1 100%; } .mc-u45-adv span { flex: 1 1 auto; }
    .mc-u45-leads { grid-template-columns: 1fr; }
    .mc-u45-range input { width: 132px; }
    .mc-u45-srb span { display: none; }
}

/* =====================================================================
   Update 46: show / hide menu, authorised signatory, opening balance
   ===================================================================== */
/* signature card (Company profile) */
.mc-u46-sign__box { height: 120px; border: 1.5px dashed var(--input); border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 10px;
    background: repeating-conic-gradient(#f3f6f8 0 25%, #fff 0 50%) 50% / 16px 16px; }
.mc-u46-sign__box img { max-width: 100%; max-height: 100px; object-fit: contain; }
.mc-u46-sign__box.is-empty { background: var(--soft); color: var(--muted); }
.mc-u46-sign__box span { display: inline-flex; align-items: center; gap: 6px; }
html.mc-dark .mc-u46-sign__box { background: #fff; }
html.mc-dark .mc-u46-sign__box.is-empty { background: var(--soft); }
.mc-u46-sign [data-pad] .mc-sign canvas { background: #fff; }

/* show / hide menu */
.mc-u46-mg { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.mc-u46-mg__c { margin: 0; padding: 0; overflow: hidden; }
.mc-u46-mg__h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--soft); border-bottom: 1px solid var(--line); }
.mc-u46-mg__h em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; }
.mc-u46-mg__all { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--ink); }
.mc-u46-mg__all i { color: var(--brand); font-size: 18px; }
.mc-u46-mg__all input, .mc-u46-mi input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--brand); }
.mc-u46-mg__l { display: flex; flex-direction: column; padding: 4px 6px; }
.mc-u46-mi { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.mc-u46-mi:hover { background: var(--soft); }
.mc-u46-mi > i { font-size: 17px; color: var(--muted); width: 20px; text-align: center; }
.mc-u46-mi span { flex: 1 1 auto; min-width: 0; }
.mc-u46-mi small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mc-u46-mi input:not(:checked) ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(107, 129, 145, .5); }
.mc-u46-mi.is-locked { cursor: default; opacity: .8; }
.mc-u46-print { white-space: nowrap; }
@media (max-width: 575px) { .mc-u46-mg { grid-template-columns: 1fr; } }

/* =====================================================================
   Update 47: page help panel ((i) button next to the financial year)
   ===================================================================== */
.mc-help { position: fixed; inset: 0; z-index: 1065; pointer-events: none; }
.mc-help__back { position: absolute; inset: 0; background: rgba(15, 47, 61, .32); opacity: 0; transition: opacity .2s; }
.mc-help__box { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--card);
    box-shadow: -18px 0 50px rgba(15, 47, 61, .18); transform: translateX(104%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); color: var(--text); }
.mc-help.is-open { pointer-events: auto; }
.mc-help.is-open .mc-help__back { opacity: 1; }
.mc-help.is-open .mc-help__box { transform: none; }
html.mc-help-on, html.mc-help-on body { overflow: hidden; }
.mc-help__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.mc-help__ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-600); font-size: 21px; }
.mc-help__ttl { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.mc-help__ttl small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mc-help__ttl b { display: block; font-size: 18px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-help__lang, .mc-help__x { flex: 0 0 auto; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.mc-help__x { width: 38px; padding: 0; font-size: 20px; }
.mc-help__lang:hover, .mc-help__x:hover { background: var(--soft); border-color: var(--input); }
.mc-help__lang i { font-size: 16px; }
.mc-help__search { position: relative; margin: 12px 16px 4px; }
.mc-help__search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.mc-help__search input { width: 100%; height: 42px; border: 1px solid var(--input); border-radius: 12px; padding: 0 12px 0 38px; font: inherit; font-size: 14px; background: var(--card); color: var(--text); outline: 0; }
.mc-help__search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.mc-help__body { flex: 1 1 auto; overflow-y: auto; padding: 6px 16px 16px; font-size: 14px; line-height: 1.55; outline: 0; overscroll-behavior: contain; }
.mc-help__sec { padding: 12px 0 4px; }
.mc-help__sec + .mc-help__sec { border-top: 1px solid var(--line-2); }
.mc-help__sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.mc-help__sec h3 i { color: var(--brand-600); font-size: 17px; }
.mc-help__sec p { margin: 0 0 6px; }
.mc-help__sec ol, .mc-help__sec ul { margin: 0 0 6px; padding-left: 22px; }
.mc-help__sec li { margin: 0 0 6px; padding-left: 2px; }
.mc-help__sec ol li::marker { color: var(--brand-600); font-weight: 800; }
.mc-help__sec ul li::marker { color: var(--faint); }
.mc-help__body b { color: var(--ink); font-weight: 700; }
.mc-help__rel { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.mc-help__chip { display: inline-flex; align-items: center; gap: 2px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; box-shadow: 0 1px 2px rgba(15, 47, 61, .05); }
.mc-help__chip:hover { border-color: var(--brand); background: var(--brand-50); }
.mc-help__chip i { font-size: 15px; color: var(--muted); }
.mc-help__other { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 8px 0 2px; padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; font-weight: 700; }
.mc-help__other a { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-700) !important; text-decoration: none !important; }
.mc-help__msg { display: flex; gap: 8px; align-items: flex-start; padding: 22px 4px; color: var(--muted); }
.mc-help__msg i { font-size: 18px; }
.mc-help__count { margin: 10px 0 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.mc-help__res { display: flex; flex-direction: column; gap: 6px; }
.mc-help__hit { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text) !important; text-decoration: none !important; }
.mc-help__hit:hover, .mc-help__hit:focus { border-color: var(--brand); background: var(--brand-50); outline: 0; }
.mc-help__hit b { display: block; font-size: 14px; color: var(--ink); }
.mc-help__hit span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; color: var(--muted); }
.mc-help mark { background: #fff1b8; color: inherit; padding: 0 1px; border-radius: 3px; }
html.mc-dark .mc-help mark { background: #5a4a12; }
.mc-help__foot { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: var(--soft); }
.mc-help[lang="gu"] .mc-help__box { font-family: "Noto Sans Gujarati", var(--font); }
html.mc-dark .mc-help__back { background: rgba(0, 0, 0, .5); }
@media (max-width: 575px) {
    .mc-help__box { width: 100vw; }
    .mc-help__foot { display: none; }
    .mc-help__head { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
    .mc-help__search { margin: 10px 12px 2px; }
    .mc-help__body { padding: 4px 12px calc(16px + env(safe-area-inset-bottom)); }
    .mc-help__lang { padding: 0 9px; }
}
@media print { .mc-help, .mc-help-btn { display: none !important; } }
/* phones: the bottom bar already has the big "New" button, so the top "+" makes room for the help button */
@media (max-width: 575px) { .mc-top__actions > .mc-new-wrap { display: none; } }

/* =====================================================================
   Update 48: new customer / product without leaving the bill
   ===================================================================== */
.mc-cbx__new { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line-2); margin-top: 4px; border-radius: 8px; font-weight: 700; color: var(--brand-700); cursor: pointer; min-height: 44px; }
.mc-cbx__new i { font-size: 17px; }
.mc-cbx__new b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-cbx__new:hover, .mc-cbx__new.is-cur { background: var(--brand-50); }
.mc-qa48-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); font-weight: 700; font-size: 14px; color: var(--brand-700); cursor: pointer; background: var(--card); min-height: 44px; }
.mc-qa48-foot b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-qa48-foot i { font-size: 17px; }
.mc-qa48-foot:hover, .mc-qa48-foot.is-hot { background: var(--brand-50); }
.mc-qa48 { z-index: 1062; }
.modal-backdrop.mc-qa48-bd { z-index: 1061; }
.mc-qa48 .form-group { margin-bottom: 12px; }
.mc-qa48 label { font-weight: 700; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.mc-qa48 .mc-hint { display: flex; gap: 5px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.mc-qa48 .mc-hint.is-ok { color: var(--green); }
.mc-qa48 .mc-hint.is-bad { color: var(--red); }
.mc-qa48__note { display: flex; gap: 6px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mc-qa48__note i { margin-top: 2px; }
.mc-qa48 .modal-footer .btn { min-width: 150px; }
/* phones: a sheet from the bottom, the keyboard does not hide the Save button */
@media (max-width: 575px) {
    .mc-qa48 .modal-dialog { margin: 0; position: fixed; left: 0; right: 0; bottom: 0; max-width: none; min-height: 0; align-items: flex-end; transform: translateY(30px); transition: transform .2s ease-out; }
    .mc-qa48.show .modal-dialog { transform: none; }
    .mc-qa48 .modal-content { border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh; }
    .mc-qa48 .modal-body { overflow-y: auto; }
    .mc-qa48 .modal-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .mc-qa48 .modal-footer .btn { width: 100%; height: 46px; }
    .mc-qa48 .form-control { height: 44px; font-size: 16px; }
}

/* =====================================================================
   Update 49: quotation - customer's own material (job work)
   ===================================================================== */
.mc-job49 { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 9px 12px; border: 1px dashed var(--input); border-radius: 12px; cursor: pointer; background: var(--card); user-select: none; }
.mc-job49__chk { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mc-job49__sw { flex: 0 0 40px; width: 40px; height: 22px; border-radius: 22px; background: var(--line); position: relative; transition: background .15s; }
.mc-job49__sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.mc-job49__chk:checked + .mc-job49__sw { background: var(--accent); }
.mc-job49__chk:checked + .mc-job49__sw::after { transform: translateX(18px); }
.mc-job49__chk:focus-visible + .mc-job49__sw { box-shadow: 0 0 0 3px var(--brand-100); }
.mc-job49__txt { min-width: 0; line-height: 1.25; }
.mc-job49__txt b { display: block; font-size: 13.5px; color: var(--ink); }
.mc-job49__txt small { display: block; font-size: 11.5px; color: var(--muted); }
.mc-job49-on .mc-job49 { border-style: solid; border-color: var(--accent); background: var(--accent-50); }
.mc-job49-on [id$="txtRate"] { background: var(--soft); color: var(--muted); }
/* the line in the item table: "Customer's material" instead of rate 0 */
#tblProducts tr.mc-job49-row td { background: var(--accent-50); }
#tblProducts td.mc-job49-rate { font-size: 0 !important; white-space: nowrap; }
#tblProducts td.mc-job49-rate::after { content: attr(data-mc-job); font-size: 11.5px; font-weight: 800; color: var(--accent); }
.bp-own49 { color: #b5541f; font-weight: 700; white-space: nowrap; }
.mc-job49.mc-job49--hide { display: none; }

/* =====================================================================
   Update 50: bill step bar (Customer / Items / Payment) + room for the keyboard
   ===================================================================== */
.mc-billsteps, .mc-billsteps-mark { display: none; }
@media (max-width: 991px) {
    .mc-billsteps { display: flex; gap: 6px; position: sticky; top: var(--top-h); z-index: 26; margin: 0 0 12px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 14px rgba(0, 0, 0, .05); }
    .mc-billsteps-mark { display: block; height: 0; }
    .mc-billsteps button { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
    .mc-billsteps button span { overflow: hidden; text-overflow: ellipsis; }
    .mc-billsteps button b { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
    .mc-billsteps button.is-done b { background: var(--green, #16a34a); color: #fff; }
    .mc-billsteps button.is-cur { background: var(--brand-50); color: var(--brand-700); }
    .mc-billsteps button.is-cur b { background: var(--brand); color: #fff; }
    html.mc-dark .mc-billsteps { background: var(--card); border-color: var(--line); }
}
/* space below the page while typing, so a box near the end can still move up under the top bar */
html.mc-kb-room body { padding-bottom: 60vh; }
@media print { .mc-billsteps { display: none !important; } }
