/* LE WEB MAX — thème enfant de Twenty-One · JNK */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --lwm-bg: #f5f7fb;
    --lwm-surface: #ffffff;
    --lwm-border: #e6eaf2;
    --lwm-border-strong: #d7dde9;
    --lwm-text: #0f172a;
    --lwm-muted: #64748b;
    --lwm-primary: #030673;
    --lwm-primary-600: #020452;
    --lwm-primary-50: #eef1fc;
    --lwm-ok: #0f8a5f;
    --lwm-ok-50: #e8f7f0;
    --lwm-warn: #a15c07;
    --lwm-warn-50: #fff5e5;
    --lwm-danger: #c62828;
    --lwm-danger-50: #fdecec;
    --lwm-radius: 14px;
    --lwm-radius-sm: 10px;
}

/* =====================================================================
   GLOBAL LAYER — applies to every page of the client area
   ===================================================================== */

/* ---------- Base ---------- */
body.primary-bg-color {
    background: var(--lwm-bg);
    color: var(--lwm-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
body.primary-bg-color h1, body.primary-bg-color h2, body.primary-bg-color h3,
body.primary-bg-color h4, body.primary-bg-color h5, body.primary-bg-color h6 {
    color: var(--lwm-text); font-weight: 600; letter-spacing: -0.01em;
}
a { color: var(--lwm-primary); }
a:hover { color: var(--lwm-primary-600); }
.text-primary { color: var(--lwm-primary) !important; }
.bg-primary { background-color: var(--lwm-primary) !important; }
.text-muted { color: var(--lwm-muted) !important; }
hr { border-top-color: var(--lwm-border); }
::selection { background: rgba(3, 6, 115, .15); }

/* ---------- Header ---------- */
header.header .topbar { background: var(--lwm-text); padding: 4px 0; }
header.header .topbar .btn,
header.header .topbar .active-client .btn,
header.header .topbar .active-client .input-group-text { color: rgba(255, 255, 255, .72); font-size: 13px; }
header.header .topbar .btn:hover { color: #fff; }
header.header .topbar .active-client .btn.btn-active-client span { border-bottom-color: rgba(255, 255, 255, .35); }
header.header .navbar-light { background: var(--lwm-surface); padding-top: 14px; padding-bottom: 14px; }
header.header .logo-img { max-height: 46px; }
header.header .search { border-color: var(--lwm-border-strong); border-radius: var(--lwm-radius-sm); overflow: hidden; background: #fff; }
header.header .search:focus-within { border-color: var(--lwm-primary); box-shadow: 0 0 0 3px rgba(3, 6, 115, .12); }
header.header .toolbar .nav-link { border-color: var(--lwm-border-strong); color: var(--lwm-muted); border-radius: var(--lwm-radius-sm); }
header.header .toolbar .nav-link:hover { color: var(--lwm-primary); border-color: var(--lwm-primary); }
header.header .toolbar .nav-link .badge { background: var(--lwm-primary); color: #fff; opacity: 1; }
header.header .main-navbar-wrapper { background: var(--lwm-surface); border-top: 1px solid var(--lwm-border); border-bottom: 1px solid var(--lwm-border); }
header.header .navbar a, header.header .main-navbar-wrapper .navbar-nav .nav-link { color: var(--lwm-text); font-weight: 500; font-size: 14.5px; }
header.header .main-navbar-wrapper .navbar-nav .nav-link:hover,
header.header .main-navbar-wrapper .navbar-nav .active > .nav-link,
header.header .main-navbar-wrapper .navbar-nav .show > .nav-link { color: var(--lwm-primary); }
.dropdown-menu {
    border: 1px solid var(--lwm-border); border-radius: 12px; padding: 6px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .10);
}
.dropdown-item { border-radius: 8px; padding: 8px 12px; color: var(--lwm-text) !important; font-size: 14px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--lwm-primary-50); color: var(--lwm-primary) !important; }
header.header .dropdown-item.active, header.header .dropdown-item:active, .dropdown-item.active, .dropdown-item:active {
    background: var(--lwm-primary-50); color: var(--lwm-primary) !important;
}
.dropdown-divider { border-top-color: var(--lwm-border); }
.popover { border-color: var(--lwm-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .10); }

/* ---------- Breadcrumb & page body ---------- */
.master-breadcrumb { background: transparent; }
.master-breadcrumb .breadcrumb { background: transparent; padding: 16px 0 0; font-size: 13px; }
.master-breadcrumb .breadcrumb-item, .master-breadcrumb .breadcrumb-item a { color: var(--lwm-muted); }
.master-breadcrumb .breadcrumb-item.active { color: var(--lwm-text); }
#main-body { padding-top: 22px; padding-bottom: 48px; }
.primary-content .card-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.header-lined h1 { font-size: 24px; }

/* ---------- Cards ---------- */
.card, .mc-promo-manage, .mc-promo-login {
    border: 1px solid var(--lwm-border); border-radius: var(--lwm-radius); box-shadow: none; background: var(--lwm-surface);
}
.card-header, .card-footer { background: transparent; border-color: var(--lwm-border); }
.card-header:first-child { border-radius: var(--lwm-radius) var(--lwm-radius) 0 0; }
.card-footer:last-child { border-radius: 0 0 var(--lwm-radius) var(--lwm-radius); }
.card-body { padding: 1.35rem; }

/* ---------- Sidebar ---------- */
.sidebar .card { margin-bottom: 18px; overflow: hidden; }
.sidebar .card-header { padding: 14px 18px; }
.sidebar .card-title { font-size: 14px !important; font-weight: 600; color: var(--lwm-text); }
.sidebar .card-title i { color: var(--lwm-muted); }
.sidebar .list-group { font-size: 14px; }
.sidebar .list-group-item { padding: 10px 18px; border-color: var(--lwm-border); color: var(--lwm-text); }
.sidebar .list-group-item:hover { background: #f8fafc; color: var(--lwm-primary); }
.sidebar .list-group-item.active, .sidebar .list-group-item.active:hover, .sidebar .list-group-item.active:focus {
    background: var(--lwm-primary-50); border-color: var(--lwm-border); color: var(--lwm-primary); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--lwm-primary);
}
.sidebar .list-group-item .badge { background: #f1f4f9; color: var(--lwm-muted); border-radius: 999px; width: auto; min-width: 26px; padding: 4px 8px; }
.sidebar .list-group-item.active .badge { background: #fff; color: var(--lwm-primary); }
.sidebar .list-group-item > i.far.fa-circle { color: var(--lwm-border-strong); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--lwm-radius-sm); font-weight: 500; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn:focus, .btn.focus { box-shadow: 0 0 0 3px rgba(3, 6, 115, .15) !important; }
.btn-primary, .btn-success, .btn-info {
    background: var(--lwm-primary); border-color: var(--lwm-primary); color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active,
.btn-success:hover, .btn-success:focus, .btn-success:not(:disabled):not(.disabled):active,
.btn-info:hover, .btn-info:focus {
    background: var(--lwm-primary-600); border-color: var(--lwm-primary-600); color: #fff;
}
.btn-default, .btn-secondary, .btn-light, .btn-outline-secondary {
    background: #fff; border-color: var(--lwm-border-strong); color: var(--lwm-text);
}
.btn-default:hover, .btn-default:focus, .btn-secondary:hover, .btn-light:hover, .btn-outline-secondary:hover,
.btn-default:not(:disabled):not(.disabled):active {
    background: #fff; border-color: var(--lwm-primary); color: var(--lwm-primary);
}
.btn-outline-primary { color: var(--lwm-primary); border-color: var(--lwm-primary); }
.btn-outline-primary:hover { background: var(--lwm-primary); border-color: var(--lwm-primary); color: #fff; }
.btn-danger { background: #fff; border-color: #f3c9c9; color: var(--lwm-danger); }
.btn-danger:hover, .btn-danger:focus { background: var(--lwm-danger); border-color: var(--lwm-danger); color: #fff; }
.btn-warning { background: var(--lwm-warn-50); border-color: #f6d9a8; color: var(--lwm-warn); }
.btn-link { color: var(--lwm-primary); }

/* ---------- Forms ---------- */
.form-control, .custom-select {
    border-radius: var(--lwm-radius-sm); border-color: var(--lwm-border-strong); color: var(--lwm-text);
}
.form-control:focus, .custom-select:focus {
    border-color: var(--lwm-primary); box-shadow: 0 0 0 3px rgba(3, 6, 115, .12);
}
.input-group-text { background: #f8fafc; border-color: var(--lwm-border-strong); color: var(--lwm-muted); }
.input-group > .form-control:not(:first-child):not(:last-child) { border-radius: 0; }
.input-group > .form-control:first-child:not(:last-child) { border-radius: var(--lwm-radius-sm) 0 0 var(--lwm-radius-sm); }
.input-group > .form-control:not(:first-child):last-child { border-radius: 0 var(--lwm-radius-sm) var(--lwm-radius-sm) 0; }
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-prepend > .btn { border-radius: var(--lwm-radius-sm) 0 0 var(--lwm-radius-sm); }
.input-group > .input-group-append > .input-group-text,
.input-group > .input-group-append > .btn { border-radius: 0 var(--lwm-radius-sm) var(--lwm-radius-sm) 0; }
label, .col-form-label { font-weight: 500; color: var(--lwm-text); }
.custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before {
    background-color: var(--lwm-primary); border-color: var(--lwm-primary);
}
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 3px rgba(3, 6, 115, .15); }

/* ---------- Tables & lists (services, invoices, domains, tickets...) ---------- */
.table { color: var(--lwm-text); }
.table th, .table td { border-top-color: var(--lwm-border); }
.table thead th { border-bottom: 1px solid var(--lwm-border); }
.dataTables_wrapper table.table-list, table.table-list {
    border: 1px solid var(--lwm-border) !important; border-radius: var(--lwm-radius) !important;
    border-collapse: separate !important; border-spacing: 0; overflow: hidden; background: #fff;
}
.dataTables_wrapper table.table-list thead th, table.table-list thead th {
    background: #f8fafc; color: var(--lwm-muted); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--lwm-border) !important; padding: 12px 10px;
}
.dataTables_wrapper table.table-list thead th.sorting_asc,
.dataTables_wrapper table.table-list thead th.sorting_desc { background: var(--lwm-primary-50); color: var(--lwm-primary); }
table.table-list tbody td { padding: 14px 10px; font-size: 14px; border-top: 1px solid var(--lwm-border); }
.table-list > tbody > tr:hover > td { background: #f7f8fd; }
.dataTables_wrapper .dataTables_filter label .form-control { border-radius: var(--lwm-radius-sm); }
.dataTables_wrapper .dataTables_info { color: var(--lwm-muted); font-size: 13px; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }

/* Pagination */
.page-link { color: var(--lwm-text); border-color: var(--lwm-border); }
.page-link:hover { color: var(--lwm-primary); background: var(--lwm-primary-50); border-color: var(--lwm-border); }
.page-item.active .page-link { background: var(--lwm-primary); border-color: var(--lwm-primary); }
.page-item:first-child .page-link { border-radius: 8px 0 0 8px; }
.page-item:last-child .page-link { border-radius: 0 8px 8px 0; }

/* ---------- Status labels as soft pills ---------- */
.label, .label.status {
    display: inline-block; border-radius: 999px; padding: .38em .85em; font-size: 12px; font-weight: 600;
    line-height: 1.2; letter-spacing: .01em; color: var(--lwm-muted); background: #f1f4f9;
}
.status-active, .status-open, .status-completed, .status-paid, .status-accepted, .label-success {
    background: var(--lwm-ok-50) !important; color: var(--lwm-ok) !important;
}
.status-pending, .status-pending-transfer, .status-pending-registration, .status-suspended,
.status-customer-reply, .status-refunded, .status-grace, .status-redemption, .status-payment-pending, .label-warning {
    background: var(--lwm-warn-50) !important; color: var(--lwm-warn) !important;
}
.status-unpaid, .status-inprogress, .status-collections, .label-danger {
    background: var(--lwm-danger-50) !important; color: var(--lwm-danger) !important;
}
.status-answered, .status-onhold, .status-delivered, .label-info {
    background: var(--lwm-primary-50) !important; color: var(--lwm-primary) !important;
}
.status-closed, .status-cancelled, .status-terminated, .status-expired, .status-transferred-away, .label-default {
    background: #f1f4f9 !important; color: var(--lwm-muted) !important;
}
.status-fraud, .status-lost, .status-dead { background: var(--lwm-text) !important; color: #fff !important; }

/* Badges */
.badge { border-radius: 999px; font-weight: 600; padding: .4em .7em; }
.badge-primary, .badge-info { background: var(--lwm-primary); }
.badge-success { background: var(--lwm-ok); }
.badge-warning { background: #f59e0b; color: #fff; }
.badge-danger { background: var(--lwm-danger); }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--lwm-border); gap: 4px; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--lwm-muted);
    font-weight: 500; padding: 10px 14px;
}
.nav-tabs .nav-link:hover { color: var(--lwm-text); border-bottom-color: var(--lwm-border-strong); }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
    color: var(--lwm-primary); background: transparent; border-bottom-color: var(--lwm-primary);
}
.nav-pills .nav-link { border-radius: var(--lwm-radius-sm); color: var(--lwm-text); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--lwm-primary); }

/* ---------- Product / service details ---------- */
div.product-details div.product-icon { background: var(--lwm-primary-50); color: var(--lwm-primary); border-radius: var(--lwm-radius); }
.product-status { border-radius: var(--lwm-radius-sm); overflow: hidden; }
.product-status-text { font-weight: 600; letter-spacing: .04em; font-size: 12px; }
.product-status-active { background: var(--lwm-ok); }
.product-status-pending { background: #f59e0b; }
.product-status-suspended { background: var(--lwm-danger); }
.product-status-terminated, .product-status-cancelled { background: var(--lwm-muted); }
div.product-details-tab-container { border-color: var(--lwm-border); border-radius: 0 0 var(--lwm-radius) var(--lwm-radius); }

/* ---------- Alerts, modals, misc ---------- */
.alert { border-radius: var(--lwm-radius-sm); border: 1px solid transparent; font-size: 14px; }
.alert-info, .alert-primary { background: var(--lwm-primary-50); border-color: #d5daf3; color: #030673; }
.alert-success { background: var(--lwm-ok-50); border-color: #c7ecdc; color: #0b6b4a; }
.alert-warning { background: var(--lwm-warn-50); border-color: #f6dfb4; color: #7a4705; }
.alert-danger { background: var(--lwm-danger-50); border-color: #f5cccc; color: #9b1c1c; }
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .18); }
.modal-header, .modal-footer { border-color: var(--lwm-border); }
.list-group-item.active { background: var(--lwm-primary); border-color: var(--lwm-primary); }
.progress { border-radius: 999px; background: #eef1f6; }
.progress-bar { background: var(--lwm-primary); }
.ticket-reply { border-radius: var(--lwm-radius); }

/* ---------- Footer ---------- */
footer.footer { background: var(--lwm-text); color: rgba(255, 255, 255, .72); padding: 40px 0 36px; }
footer.footer .nav-link { color: rgba(255, 255, 255, .8); font-size: 14px; }
footer.footer .nav-link:hover { color: #fff; }
footer.footer .btn { background: rgba(255, 255, 255, .08); border-radius: 8px; }
footer.footer .copyright { color: rgba(255, 255, 255, .55); margin: 20px 0 0; }

@media (max-width: 575.98px) {
    body.primary-bg-color { font-size: 14px; }
    #main-body { padding-top: 14px; }
    .card-body { padding: 1rem; }
    header.header .navbar-light { padding-top: 10px; padding-bottom: 10px; }
}

/* Dashboard page: no breadcrumb noise */
body:has(.lwm) .master-breadcrumb { display: none; }
body:has(.lwm) #main-body { padding-top: 28px; }

/* ---------- Dashboard ---------- */
.lwm { color: var(--lwm-text); font-size: 15px; line-height: 1.5; }
.lwm *, .lwm *::before, .lwm *::after { box-sizing: border-box; }
.lwm a { text-decoration: none; }
.lwm h1, .lwm h2 { color: var(--lwm-text); margin: 0; letter-spacing: -0.01em; }

/* Hero */
.lwm-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap; margin-bottom: 24px;
}
.lwm-hero h1 { font-size: 28px; font-weight: 700; }
.lwm-status { margin: 6px 0 0; color: var(--lwm-muted); display: flex; align-items: center; gap: 8px; }
.lwm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lwm-ok); flex: none; }
.lwm-status-warning .lwm-dot { background: #f59e0b; }
.lwm-status-danger .lwm-dot { background: var(--lwm-danger); }
.lwm-status-danger { color: var(--lwm-danger); font-weight: 500; }
.lwm-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.lwm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: var(--lwm-radius-sm);
    font-weight: 600; font-size: 14px; border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.lwm-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.lwm-btn-primary { background: var(--lwm-primary); color: #fff !important; }
.lwm-btn-primary:hover { background: var(--lwm-primary-600); }
.lwm-btn-ghost { background: var(--lwm-surface); color: var(--lwm-text) !important; border-color: var(--lwm-border-strong); }
.lwm-btn-ghost:hover { border-color: var(--lwm-primary); color: var(--lwm-primary) !important; }
.lwm-btn-light { background: #fff; color: var(--lwm-primary) !important; }
.lwm-btn-light:hover { background: var(--lwm-primary-50); }
.lwm-link { font-size: 14px; font-weight: 600; color: var(--lwm-primary); }
.lwm-link:hover { text-decoration: underline !important; }
.lwm-icon-btn {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--lwm-border-strong); color: var(--lwm-muted) !important; font-size: 13px;
}
.lwm-icon-btn:hover { color: var(--lwm-primary) !important; border-color: var(--lwm-primary); }

/* KPIs */
.lwm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.lwm-kpi {
    background: var(--lwm-surface); border: 1px solid var(--lwm-border); border-radius: var(--lwm-radius);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
    transition: border-color .15s ease, transform .15s ease;
}
.lwm-kpi:hover { border-color: var(--lwm-primary); }
.lwm-kpi-label { font-size: 13px; color: var(--lwm-muted); font-weight: 500; }
.lwm-kpi-value { font-size: 26px; font-weight: 700; color: var(--lwm-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.lwm-kpi-alert { border-color: #f3c9c9; background: linear-gradient(0deg, var(--lwm-danger-50), var(--lwm-danger-50)), var(--lwm-surface); }
.lwm-kpi-alert .lwm-kpi-value { color: var(--lwm-danger); }

/* Cards */
.lwm-card {
    background: var(--lwm-surface); border: 1px solid var(--lwm-border); border-radius: var(--lwm-radius);
    padding: 20px 22px; margin-bottom: 24px;
}
.lwm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.lwm-card-head h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.lwm-card-head h2 i { color: var(--lwm-muted); font-size: 15px; width: 18px; text-align: center; }
.lwm-card-foot { margin: 12px 0 0; font-size: 13px; color: var(--lwm-muted); display: flex; align-items: center; gap: 8px; }
.lwm-due { border-color: #cdd3f0; box-shadow: 0 1px 0 rgba(3, 6, 115, .04); }
.lwm-due .lwm-card-head h2 i { color: var(--lwm-primary); }

.lwm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.lwm-grid .lwm-card { margin-bottom: 0; }

/* Rows */
.lwm-list { list-style: none; margin: 0; padding: 0; }
.lwm-row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 0; border-top: 1px solid var(--lwm-border);
}
.lwm-list .lwm-row:first-child { border-top: 0; }
.lwm-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lwm-row-title {
    color: var(--lwm-text) !important; font-weight: 600; font-size: 15px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.lwm-row-title:hover { color: var(--lwm-primary) !important; }
.lwm-row-meta { font-size: 13px; color: var(--lwm-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lwm-row-side { display: flex; align-items: center; gap: 10px; flex: none; }
.lwm-amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Pills */
.lwm-pill {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.lwm-pill-active { background: var(--lwm-ok-50); color: var(--lwm-ok); }
.lwm-pill-pending, .lwm-pill-warning { background: var(--lwm-warn-50); color: var(--lwm-warn); }
.lwm-pill-suspended, .lwm-pill-danger { background: var(--lwm-danger-50); color: var(--lwm-danger); }
.lwm-pill-info { background: var(--lwm-primary-50); color: var(--lwm-primary); }
.lwm-pill-neutral { background: #f1f4f9; color: var(--lwm-muted); }

/* Empty states & text */
.lwm-empty { padding: 18px 0 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.lwm-empty p, .lwm-muted { margin: 0; color: var(--lwm-muted); font-size: 14px; }
.lwm-muted { padding: 10px 0 4px; }

/* Support contacts */
.lwm-contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.lwm-contact-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 14px 8px; border: 1px solid var(--lwm-border); border-radius: var(--lwm-radius-sm);
    color: var(--lwm-text) !important; font-size: 13px; font-weight: 500; text-align: center;
    transition: border-color .15s ease, background .15s ease;
}
.lwm-contact-item i { font-size: 18px; color: var(--lwm-primary); }
.lwm-contact-item .fa-whatsapp { color: #1fa855; }
.lwm-contact-item:hover { border-color: var(--lwm-primary); background: var(--lwm-primary-50); }
.lwm-contact-item span { overflow-wrap: anywhere; }

/* News & offers */
.lwm-news { display: flex; flex-direction: column; gap: 16px; }
.lwm-promo {
    border-radius: var(--lwm-radius-sm); padding: 20px; color: #fff;
    background: linear-gradient(135deg, #030673 0%, #0a1199 55%, #2b33b8 100%);
}
.lwm .lwm-promo h2 { color: #fff; font-size: 17px; font-weight: 700; }
.lwm-promo p { margin: 6px 0 14px; color: rgba(255, 255, 255, .88); font-size: 14px; }
.lwm-news-item { display: flex; flex-direction: column; gap: 2px; padding: 4px 2px; }
.lwm-news-item .lwm-row-title { white-space: normal; }

/* =====================================================================
   APP SHELL — fixed sidebar navigation (Lagom-like layout)
   ===================================================================== */
:root { --lwa-side-w: 264px; }
body.lwa { background: var(--lwm-bg); }
.lwa-shell { min-height: 100vh; }

/* Sidebar */
.lwa-side {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--lwa-side-w); z-index: 1040;
    background: var(--lwm-surface); border-right: 1px solid var(--lwm-border);
    display: flex; flex-direction: column;
}
.lwa-side-head {
    height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; border-bottom: 1px solid var(--lwm-border);
}
.lwa-logo img { max-height: 40px; max-width: 180px; display: block; }
.lwa-logo span { font-weight: 700; font-size: 18px; color: var(--lwm-text); }
.lwa-nav { flex: 1; overflow-y: auto; padding: 14px 12px; scrollbar-width: thin; }
.lwa-nav-list, .lwa-sub { list-style: none; margin: 0; padding: 0; }
.lwa-nav-item + .lwa-nav-item { margin-top: 2px; }
.lwa-nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--lwm-text) !important; font-weight: 500; font-size: 14.5px; text-decoration: none !important;
    transition: background .15s ease, color .15s ease;
}
.lwa-nav-link:hover { background: #f5f7fb; }
.lwa-nav-link.active { background: var(--lwm-primary-50); color: var(--lwm-primary) !important; font-weight: 600; }
.lwa-nav-link.active-parent { color: var(--lwm-primary) !important; }
.lwa-nav-icon { width: 20px; text-align: center; color: var(--lwm-muted); font-size: 16px; flex: none; }
.lwa-nav-link.active .lwa-nav-icon, .lwa-nav-link.active-parent .lwa-nav-icon { color: var(--lwm-primary); }
.lwa-caret { margin-left: auto; font-size: 10px; color: var(--lwm-muted); transition: transform .2s ease; }
.lwa-has-sub:not(.collapsed) .lwa-caret { transform: rotate(180deg); }
.lwa-sub { padding: 4px 0 8px 32px; }
.lwa-sub-link {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--lwm-muted) !important; text-decoration: none !important;
}
.lwa-sub-link:hover { color: var(--lwm-text) !important; background: #f5f7fb; }
.lwa-sub-link.active { color: var(--lwm-primary) !important; background: var(--lwm-primary-50); font-weight: 600; }
.lwa-sub-divider { height: 1px; background: var(--lwm-border); margin: 6px 12px; }
.lwa-badge {
    margin-left: auto; background: var(--lwm-primary-50); color: var(--lwm-primary);
    border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 8px; line-height: 1.4;
}
.lwa-side-foot { flex: none; padding: 16px; border-top: 1px solid var(--lwm-border); }
.lwa-help {
    background: linear-gradient(135deg, #0f172a 0%, #1d3a8a 100%); color: #fff; border-radius: 14px;
    padding: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px;
}
.lwa-help strong { font-size: 14px; }
.lwa-help > span { color: rgba(255, 255, 255, .75); }
.lwa-help-actions { display: flex; gap: 8px; margin-top: 12px; }
.lwa-help-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px;
    border-radius: 8px; background: rgba(255, 255, 255, .12); color: #fff !important; font-weight: 600; font-size: 12.5px;
    text-decoration: none !important;
}
.lwa-help-btn:hover { background: rgba(255, 255, 255, .22); }

/* Main column */
.lwa-main { margin-left: var(--lwa-side-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.lwa-top {
    position: sticky; top: 0; z-index: 1030; height: 72px; flex: none;
    display: flex; align-items: center; gap: 14px; padding: 0 28px;
    background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(180%) blur(8px); backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--lwm-border);
}
.lwa-top-logo img { max-height: 32px; display: block; }
.lwa-search {
    flex: 1; max-width: 420px; align-items: center; gap: 10px; height: 42px; padding: 0 14px; margin: 0;
    background: #f5f7fb; border: 1px solid transparent; border-radius: 10px; color: var(--lwm-muted);
}
.lwa-search:focus-within { background: #fff; border-color: var(--lwm-primary); box-shadow: 0 0 0 3px rgba(3, 6, 115, .12); }
.lwa-search input { border: 0; background: transparent; outline: 0; flex: 1; min-width: 0; font-size: 14px; color: var(--lwm-text); }
.lwa-top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lwa-icon-btn {
    position: relative; width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--lwm-border); background: #fff; color: var(--lwm-text) !important;
    font-size: 16px; text-decoration: none !important; cursor: pointer; padding: 0;
}
.lwa-icon-btn:hover, .lwa-icon-btn:focus { border-color: var(--lwm-primary); color: var(--lwm-primary) !important; outline: 0; }
.lwa-dot-count {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--lwm-primary); color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-sizing: content-box;
}
.lwa-dot-count.lwa-hidden { display: none; }
.lwa-account {
    display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 5px; cursor: pointer;
    border: 1px solid var(--lwm-border); border-radius: 999px; background: #fff; color: var(--lwm-text); font-weight: 600; font-size: 14px;
}
.lwa-account:hover, .lwa-account:focus, .lwa-account[aria-expanded=true] { border-color: var(--lwm-primary); outline: 0; }
.lwa-account .fa-chevron-down { font-size: 10px; color: var(--lwm-muted); }
.lwa-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--lwm-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.lwa-account-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lwa-account-menu { min-width: 240px; margin-top: 8px !important; }
.lwa-top-link { font-weight: 600; font-size: 14px; color: var(--lwm-text) !important; padding: 0 8px; text-decoration: none !important; }
.lwa-top-link:hover { color: var(--lwm-primary) !important; }
.lwa-top-cta {
    background: var(--lwm-primary); color: #fff !important; border-radius: 10px; height: 40px;
    display: inline-flex; align-items: center; padding: 0 16px;
}
.lwa-top-cta:hover { background: var(--lwm-primary-600); color: #fff !important; }

.lwa-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.lwa-crumb { background: transparent; }
.lwa-crumb .breadcrumb { padding: 18px 0 0 !important; margin: 0; }
.lwa-main #main-body { flex: 1; padding-top: 18px; }
body:has(.lwm) .lwa-main #main-body { padding-top: 28px; }

/* Footer */
.lwa-footer { border-top: 1px solid var(--lwm-border); padding: 18px 0; color: var(--lwm-muted); font-size: 13px; }
.lwa-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lwa-copy { margin: 0; }
.lwa-footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.lwa-footer-links a { color: var(--lwm-muted); }
.lwa-footer-links a:hover { color: var(--lwm-primary); }
.lwa-locale {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--lwm-border); background: #fff;
    border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--lwm-text); cursor: pointer;
}

/* Notifications popover content */
.popover .client-alerts { list-style: none; margin: 0; padding: 0; min-width: 260px; }
.popover .client-alerts li a { display: flex; gap: 10px; padding: 8px 4px; color: var(--lwm-text); text-decoration: none; }
.popover .client-alerts li a:hover { color: var(--lwm-primary); }

/* Shell responsive */
.lwa-backdrop { display: none; }
.lwa-close { width: 36px; height: 36px; }
@media (max-width: 991.98px) {
    .lwa-side { width: 284px; transform: translateX(-100%); transition: transform .25s ease; }
    body.lwa-open .lwa-side { transform: none; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
    body.lwa-open .lwa-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
    body.lwa-open { overflow: hidden; }
    .lwa-main { margin-left: 0; }
    .lwa-top { height: 64px; padding: 0 16px; gap: 10px; }
    .lwa-container { padding: 0 16px; }
}
@media (max-width: 575.98px) {
    .lwa-top-actions { gap: 8px; }
    .lwa-account { padding: 0 8px 0 4px; }
    .lwa-top-link:not(.lwa-top-cta) { display: none; }
}
@media print {
    .lwa-side, .lwa-top, .lwa-footer, .lwa-backdrop { display: none !important; }
    .lwa-main { margin-left: 0; }
}

/* =====================================================================
   INVOICE PAGE (viewinvoice.tpl)
   ===================================================================== */
body.lwi-body {
    background: var(--lwm-bg); color: var(--lwm-text); margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
.lwi { max-width: 880px; margin: 0 auto; padding: 24px 16px 56px; }
.lwi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lwi a, .lwi a:hover { text-decoration: none; }
.lwi address { font-style: normal; }
.lwi-method .custom-select {
    height: 42px; padding: 0 36px 0 12px; border: 1px solid var(--lwm-border-strong); border-radius: var(--lwm-radius-sm);
    font-size: 14px; color: var(--lwm-text); width: 100%;
}
.lwi-back { color: var(--lwm-muted) !important; font-weight: 500; font-size: 14px; }
.lwi-back:hover { color: var(--lwm-primary) !important; text-decoration: none; }
.lwi-tools { display: flex; gap: 8px; }
.lwi-tool {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    background: #fff; border: 1px solid var(--lwm-border-strong); border-radius: var(--lwm-radius-sm);
    color: var(--lwm-text) !important; font-size: 13px; font-weight: 600;
}
.lwi-tool:hover { border-color: var(--lwm-primary); color: var(--lwm-primary) !important; text-decoration: none; }
.lwi-sheet {
    background: #fff; border: 1px solid var(--lwm-border); border-radius: 18px; padding: 32px;
}
.lwi-head { display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: start; padding-bottom: 24px; border-bottom: 1px solid var(--lwm-border); margin-bottom: 24px; }
.lwi-brand img { max-height: 52px; max-width: 240px; }
.lwi-brand strong { font-size: 20px; }
.lwi-title { grid-column: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lwi-title h1 { font-size: 24px; font-weight: 700; margin: 0; color: var(--lwm-text); }
.lwi-dates { grid-column: 2; grid-row: 1 / span 2; margin: 0; display: flex; flex-direction: column; gap: 10px; text-align: right; }
.lwi-dates dt { font-size: 12px; font-weight: 500; color: var(--lwm-muted); text-transform: uppercase; letter-spacing: .04em; }
.lwi-dates dd { margin: 0; font-weight: 600; }
.lwi-status { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.lwi-s-ok { background: var(--lwm-ok-50); color: var(--lwm-ok); }
.lwi-s-danger { background: var(--lwm-danger-50); color: var(--lwm-danger); }
.lwi-s-warn { background: var(--lwm-warn-50); color: var(--lwm-warn); }
.lwi-s-info { background: var(--lwm-primary-50); color: var(--lwm-primary); }
.lwi-s-neutral { background: #f1f4f9; color: var(--lwm-muted); }
.lwi-label { display: block; font-size: 12px; font-weight: 600; color: var(--lwm-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.lwi-muted { color: var(--lwm-muted); font-size: 13px; }
.lwi-center { text-align: center; }

.lwi-pay {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start;
    background: var(--lwm-primary-50); border: 1px solid #d5daf3; border-radius: var(--lwm-radius); padding: 22px; margin-bottom: 24px;
}
.lwi-pay-summary { display: flex; flex-direction: column; gap: 4px; }
.lwi-balance { font-size: 32px; font-weight: 700; color: var(--lwm-text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.lwi-method { margin-top: 16px; }
.lwi-method .custom-select { max-width: 280px; background-color: #fff; }
.lwi-pay-action { min-width: 0; }
.lwi-pay-action .fpw { margin: 0; max-width: none; }
.lwi-pay-action form { margin: 0; }
.lwi-pay-action .btn, .lwi-pay-action input[type=submit], .lwi-pay-action button {
    min-height: 44px; border-radius: var(--lwm-radius-sm); font-weight: 600;
}

.lwi-box { border: 1px solid var(--lwm-border); border-radius: var(--lwm-radius); padding: 20px 22px; margin-bottom: 24px; }
.lwi-box h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.lwi-credit-input { max-width: 360px; }

.lwi-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.lwi-parties address { margin: 0; font-size: 14px; line-height: 1.6; color: var(--lwm-text); }

.lwi-table { width: 100%; border-collapse: collapse; }
.lwi-table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--lwm-muted); text-transform: uppercase;
    letter-spacing: .04em; padding: 0 0 10px; border-bottom: 1px solid var(--lwm-border);
}
.lwi-table td { padding: 14px 0; border-bottom: 1px solid var(--lwm-border); vertical-align: top; font-size: 14px; }
.lwi-table th + th, .lwi-table td + td { padding-left: 16px; }
.lwi-table-sm td { padding: 10px 0; }
.lwi-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lwi-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.lwi-totals { margin: 16px 0 0 auto; max-width: 340px; }
.lwi-totals div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; }
.lwi-totals dt { font-weight: 500; color: var(--lwm-muted); }
.lwi-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.lwi-totals .lwi-grand { border-top: 1px solid var(--lwm-border); margin-top: 6px; padding-top: 12px; font-size: 17px; }
.lwi-totals .lwi-grand dt, .lwi-totals .lwi-grand dd { color: var(--lwm-text); font-weight: 700; }
.lwi-note { margin: 12px 0 0; }
.lwi-balance-row { display: flex; justify-content: flex-end; gap: 16px; padding-top: 12px; font-size: 15px; }
.lwi .card { border-radius: var(--lwm-radius); margin-bottom: 24px; }

@media (max-width: 767.98px) {
    .lwi-sheet { padding: 20px 16px; border-radius: 14px; }
    .lwi-head { grid-template-columns: 1fr; }
    .lwi-dates { grid-column: 1; grid-row: auto; flex-direction: row; gap: 24px; text-align: left; }
    .lwi-pay { grid-template-columns: 1fr; padding: 12px; margin-left: -4px; margin-right: -4px; }
    .lwi-pay .fpw { padding: 14px; }
    .lwi-pay .fpw-tab { padding: 10px 4px; font-size: 13px; }
    .lwi-balance { font-size: 28px; }
    .lwi-tool span { display: none; }
}
@media print {
    body.lwi-body { background: #fff; }
    .lwi { max-width: none; padding: 0; }
    .lwi-sheet { border: 0; padding: 0; }
    .lwi-box { break-inside: avoid; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .lwm-grid { grid-template-columns: 1fr; }
    .lwm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .lwm { font-size: 14px; }
    .lwm-hero h1 { font-size: 23px; }
    .lwm-hero-actions { width: 100%; }
    .lwm-hero-actions .lwm-btn { flex: 1; }
    .lwm-kpis { gap: 10px; margin-bottom: 18px; }
    .lwm-kpi { padding: 14px; }
    .lwm-kpi-value { font-size: 21px; }
    .lwm-card { padding: 16px; margin-bottom: 18px; border-radius: 12px; }
    .lwm-grid { gap: 18px; }
    .lwm-due .lwm-row { flex-wrap: wrap; }
    .lwm-due .lwm-row-side { width: 100%; justify-content: space-between; }
    .lwm-row-title { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    .lwm * { transition: none !important; }
}
