/*
====================================================
AME OPERATIONS
Global Stylesheet
Version : 1.0
====================================================
*/

/* ==========================================
   ROOT VARIABLES
========================================== */

:root{

    --ame-primary:#0b2e75;
    --ame-primary-hover:#143d92;

    --ame-success:#198754;
    --ame-danger:#b42318;
    --ame-warning:#b45309;
    --ame-info:#0f8b8d;
    --ame-info-hover:#0b6f71;
    --ame-secondary:#6c757d;
    --ame-secondary-hover:#565e64;

    --ame-button-height:44px;
    --ame-button-padding:10px 16px;
    --ame-button-font-size:14px;
    --ame-button-radius:8px;
    --ame-button-gap:8px;

    --ame-bg:#f4f6f9;
    --ame-surface:#ffffff;
    --ame-text:#24364b;
    --ame-muted:#607086;
    --ame-border:#dfe5ee;
    --ame-focus:#0f8b8d;
    --ame-space-1:4px;
    --ame-space-2:8px;
    --ame-space-3:12px;
    --ame-space-4:16px;
    --ame-space-5:24px;
    --ame-space-6:32px;
    --ame-card-radius:12px;

    --ame-shadow:0 2px 8px rgba(20,61,146,.06);

}

/* ==========================================
   GLOBAL STYLES
========================================== */

body{

    margin:0;

    background:#f4f6f9;

    font-family:Arial,sans-serif;

    color:var(--ame-text);

    font-size:14px;

    line-height:1.5;

}

*,*::before,*::after{box-sizing:border-box}

.wrapper{

    display:flex;

    min-height:100vh;

}

/* ==========================================
   LAYOUT
========================================== */

.content{

    margin-left:220px;

    width:calc(100% - 220px);

    padding:20px;

}

/* ==========================================
   SIDEBAR
========================================== */

.sidebar{

    width:220px;

    background:#0b2e75;

    color:white;

    padding:20px;

    position:fixed;

    top:0;

    left:0;

    bottom:0;

    overflow-y:auto;

    z-index:1000;

}

.sidebar-title{

    font-size:11px;

    font-weight:bold;

    opacity:.70;

    margin-top:25px;

    margin-bottom:8px;

    text-transform:uppercase;

}

.sidebar a{

    display:block;

    padding:9px 12px;

    margin-bottom:4px;

    border-radius:6px;

    text-decoration:none;

    font-size:14px;

    color:white;

    transition:.2s;

}

.sidebar a:hover{

    background:#143d92;

}

/* ==========================================
   TOPBAR
========================================== */

/* Reserved */

/* ==========================================
   BUTTONS
========================================== */

.btn:not(.btn-close):not(.gallery-trigger):not(.photo-indicator),
.stores-btn,
.search-btn,
.btn-delete{

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:var(--ame-button-height) !important;
    max-width:100%;
    box-sizing:border-box;
    padding:var(--ame-button-padding) !important;
    margin:0 !important;
    border-radius:var(--ame-button-radius) !important;
    font-size:var(--ame-button-font-size) !important;
    font-weight:600 !important;
    line-height:1.2 !important;
    text-align:center;
    text-decoration:none !important;
    white-space:nowrap !important;
    overflow-wrap:normal;
    word-break:normal;
    vertical-align:middle;
    cursor:pointer;
}

/* Primary actions */
.btn-primary,
.btn-outline-primary,
.btn.primary,
.btn.add,
.btn.create,
.btn.edit,
.btn.save,
.btn.view,
.stores-btn:not(.secondary):not(.danger){

    color:#fff !important;
    background:var(--ame-primary) !important;
    border-color:var(--ame-primary) !important;
}

/* Successful and active actions */
.btn-success,
.btn-outline-success{

    color:#fff !important;
    background:var(--ame-success) !important;
    border-color:var(--ame-success) !important;
}

/* Destructive actions */
.btn-danger,
.btn-outline-danger,
.btn.delete,
.btn.remove,
.btn-delete,
.stores-btn.danger{

    color:#fff !important;
    background:var(--ame-danger) !important;
    border-color:var(--ame-danger) !important;
}

/* Back and secondary actions */
.btn-secondary,
.btn-outline-secondary,
.btn.secondary,
.btn.back,
.stores-btn.secondary{

    color:#fff !important;
    background:var(--ame-secondary) !important;
    border-color:var(--ame-secondary) !important;
}

/* Downloads, exports and password resets. Kept last so meaning wins over a
   legacy secondary class while templates are progressively normalized. */
.btn-info,
.btn-outline-info,
.btn-info-action,
.btn.export,
a.btn[href*="/download"],
a.btn[href*="/export"],
a.btn[href*="/reset/"],
a.stores-btn[href*="/download"],
a.stores-btn[href*="/export"],
button.btn[onclick*="export"],
button.stores-btn[onclick*="export"]{

    color:#fff !important;
    background:var(--ame-info) !important;
    border-color:var(--ame-info) !important;
}

.btn-primary:hover,
.btn-outline-primary:hover,
.btn.primary:hover,
.btn.add:hover,
.btn.create:hover,
.btn.edit:hover,
.btn.save:hover,
.btn.view:hover,
.stores-btn:not(.secondary):not(.danger):hover{

    color:#fff !important;
    background:var(--ame-primary-hover) !important;
}

.btn-info:hover,
.btn-outline-info:hover,
.btn-info-action:hover,
.btn.export:hover,
a.btn[href*="/download"]:hover,
a.btn[href*="/export"]:hover,
a.btn[href*="/reset/"]:hover,
a.stores-btn[href*="/download"]:hover,
a.stores-btn[href*="/export"]:hover,
button.btn[onclick*="export"]:hover,
button.stores-btn[onclick*="export"]:hover{

    color:#fff !important;
    background:var(--ame-info-hover) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn.secondary:hover,
.btn.back:hover,
.stores-btn.secondary:hover{

    color:#fff !important;
    background:var(--ame-secondary-hover) !important;
}

.btn:disabled,
.btn.disabled,
.stores-btn:disabled{

    opacity:.65;
    cursor:not-allowed;
    pointer-events:none;
}

/* Shared action containers prevent controls and inline forms from colliding. */
.actions,
.action-group,
.mobile-actions,
.progress-actions,
.gallery-actions,
.media-buttons,
.stores-actions,
.sticky-post,
.card-footer{

    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center;
    gap:var(--ame-button-gap) !important;
    max-width:100%;
    min-width:0;
}

.action-group{

    flex-wrap:nowrap !important;
    min-width:max-content;
}

.actions > form,
.action-group > form,
.mobile-actions > form,
.progress-actions > form,
.gallery-actions > form,
.media-buttons > form,
.stores-actions > form,
.sticky-post > form,
.card-footer > form{

    min-width:0;
    margin:0 !important;
}

/* Legacy page-card forms place sibling controls directly in the form. Give
   those controls the same wrap spacing without requiring template rewrites. */
.page-card form > .btn:not(.btn-close):not(.gallery-trigger):not(.photo-indicator){

    margin:0 var(--ame-button-gap) var(--ame-button-gap) 0 !important;
}

/* Status labels size to their content, but may wrap safely when the available
   width is narrower than the label. */
.badge,
.status,
.progress-badge,
.desktop-progress-table .tag{

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:fit-content !important;
    min-width:0 !important;
    max-width:100% !important;
    height:auto !important;
    min-height:28px;
    padding:5px 10px !important;
    border-radius:7px !important;
    box-sizing:border-box;
    line-height:1.25 !important;
    white-space:nowrap !important;
    overflow-wrap:normal;
    word-break:normal;
    text-align:center;
    vertical-align:middle;
}

.desktop-progress-table td.photos-cell,
.desktop-progress-table td.progress-status-cell{

    vertical-align:middle !important;
}

/* ==========================================
   TABLES
========================================== */

.table-responsive{

    width:100%;

    overflow-x:auto;

    -webkit-overflow-scrolling:touch;

}

table{

    width:100%;

    border-collapse:collapse;

    background:#ffffff;

}

table th{

    background:var(--ame-primary);

    color:#ffffff;

    padding:12px;

    white-space:nowrap;

    font-size:14px;

}

table td{

    padding:12px;

    border-bottom:1px solid #e5e5e5;

    vertical-align:middle;

}

table tr:hover{

    background:#f8f9fa;

}

.action-column{

    white-space:nowrap;

    width:1%;

}

/* ==========================================
   FORMS
========================================== */

input,
select,
textarea{

    max-width:100%;
    min-height:44px;
    border:1px solid #b8c2d1;
    border-radius:8px;
    padding:10px 12px;
    background:var(--ame-surface);
    color:var(--ame-text);
    font:inherit;
}

textarea{

    min-height:88px;
    resize:vertical;
}

label{

    color:var(--ame-text);
    font-weight:600;
    font-size:14px;
    line-height:1.35;
}

:where(a,button,input,select,textarea,[tabindex]):focus-visible{

    outline:3px solid color-mix(in srgb,var(--ame-focus) 45%,transparent);
    outline-offset:2px;
}

input:disabled,
select:disabled,
textarea:disabled{

    background:#eef1f5;
    color:var(--ame-muted);
    cursor:not-allowed;
}

/* ==========================================
   CARDS
========================================== */

.page-title,
.stores-head h1{

    margin:0;
    color:var(--ame-primary);
    font-size:clamp(1.35rem,2.2vw,1.75rem);
    line-height:1.2;
}

h2,
.section-title{

    color:var(--ame-text);
    font-size:18.4px;
    line-height:1.3;
}

h3{

    font-size:1rem;
    line-height:1.35;
}

.section-title-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}

.help,
.supporting-text,
.page-subtitle{

    color:var(--ame-muted);
    font-size:12.8px;
    line-height:1.4;
}

.page-card,
.card,
.stores-panel{

    border:1px solid var(--ame-border);
    border-radius:var(--ame-card-radius);
    background:var(--ame-surface);
    box-shadow:var(--ame-shadow);
}

/* Shared configuration-page foundation. A number of governed setup screens
   intentionally use the lightweight page-shell/content-card vocabulary rather
   than a module stylesheet, so these primitives belong in the global system. */
.page-shell,
.stores-page,
.erp-page{
    box-sizing:border-box;
    width:100%;
    max-width:1500px;
    min-width:0;
    margin-inline:auto;
    padding:16px;
}

.page-shell *,
.stores-page *,
.erp-page *{
    box-sizing:border-box;
    min-width:0;
}

.page-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
    flex-wrap:wrap;
}

.page-header>div:first-child{max-width:850px}
.page-header h1{
    margin:0;
    color:var(--ame-primary);
    font-size:clamp(1.35rem,2.2vw,1.75rem);
    line-height:1.2;
}
.page-header p{margin:.35rem 0 0;color:var(--ame-muted);line-height:1.5}

.content-card{
    width:100%;
    max-width:100%;
    min-width:0;
    margin-bottom:16px;
    padding:18px;
    border:1px solid var(--ame-border);
    border-radius:var(--ame-card-radius);
    background:var(--ame-surface);
    box-shadow:var(--ame-shadow);
}
.content-card>h2:first-child{margin-top:0}

/* Forms reached from Settings keep consistent geometry even when their page
   belongs to another module. */
.stores-field{display:grid;align-content:start;gap:6px;min-width:0}
.stores-field label,.form-grid>label{margin:0;color:#24364b;font-weight:700}
.stores-field :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
.form-grid :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
    display:block;
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:44px;
    padding:10px 12px;
    border:1px solid #b8c2d1;
    border-radius:8px;
    background:#fff;
    color:var(--ame-text);
    font:inherit;
}
.stores-field textarea,.form-grid textarea{min-height:88px;resize:vertical}
.form-grid>button{align-self:end;justify-self:start}
.form-grid>label:has(> input[type="checkbox"]),
.form-grid>label:has(> input[type="radio"]){
    display:flex;
    align-items:center;
    align-self:end;
    gap:9px;
    min-height:44px;
}
.form-grid input[type="checkbox"],.form-grid input[type="radio"]{
    flex:0 0 20px;
    width:20px;
    height:20px;
    min-height:20px;
    margin:0;
    padding:0;
}

.erp-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.erp-content-card{width:100%;min-width:0;margin-bottom:16px;padding:18px;border:1px solid var(--ame-border);border-radius:12px;background:var(--ame-surface);box-shadow:var(--ame-shadow)}
.erp-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}
.erp-kpi-grid>.kpi-card{min-height:132px;padding:16px}
.erp-kpi-grid>.kpi-card>span{font-size:13.44px}
.erp-kpi-grid>.kpi-card>strong{font-size:23.2px}
.erp-filter-panel{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:18px;margin-bottom:16px}
.erp-table-wrapper,.erp-table-wrap{max-width:100%;min-width:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.erp-table-wrapper>.dense-table,.erp-table-wrap>.dense-table{min-width:860px}
.erp-guided-stepper{display:grid;gap:12px;margin-bottom:16px}
.stepper{display:flex;gap:10px;max-width:100%;overflow-x:auto;padding:2px;scrollbar-width:thin}
.stepper>span{display:flex;flex:0 0 auto;align-items:center;min-height:44px;padding:8px 12px;border:1px solid var(--ame-border);border-radius:8px;background:#f7f9fc;color:var(--ame-primary);font-weight:700;white-space:nowrap}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid>label{display:grid;align-content:start;gap:6px;min-width:0;font-weight:700}
.form-grid :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){display:block;width:100%;max-width:100%;min-width:0;min-height:44px}
.form-grid .helper-text{display:block;min-width:0;color:var(--ame-muted);font-size:12.8px;font-weight:400;overflow-wrap:anywhere}
.quality-plan-cards{display:none}
.item-lifecycle-form{display:flex;align-items:end;gap:8px;min-width:0;flex-wrap:wrap}
.item-lifecycle-form label{display:grid;gap:5px;min-width:180px;font-weight:700}
.item-lifecycle-form .item-lifecycle-confirm{display:flex;align-items:center;min-width:auto;min-height:44px;gap:8px}
.item-lifecycle-confirm input{width:20px;height:20px}
.erp-confirmation-modal{box-sizing:border-box;width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border-radius:12px}
.erp-breadcrumbs{margin:0 0 12px}.erp-breadcrumbs ol{display:flex;align-items:center;gap:8px;list-style:none;margin:0;padding:0;color:var(--ame-muted);font-size:12.8px}.erp-breadcrumbs li+li::before{content:"/";margin-right:8px;color:#8b98aa}.erp-breadcrumbs a{color:var(--ame-primary-hover)}
.erp-next-action{margin-bottom:16px;padding:14px 18px;border-left:4px solid var(--ame-focus);border-radius:8px;background:#eef8f8}.erp-next-action strong{display:block;color:var(--ame-primary)}.erp-next-action p{margin:4px 0 0;color:var(--ame-muted)}
.erp-destructive-confirmation{display:grid;gap:12px;padding:18px;border:1px solid #efb4ae;border-radius:12px;background:#fff7f6}.erp-destructive-confirmation label{display:grid;gap:8px}.erp-destructive-confirmation label:first-child{grid-template-columns:20px 1fr;align-items:start;min-height:44px}.erp-destructive-confirmation input[type="checkbox"]{width:20px;height:20px}

.kpi-card > span{

    display:block;
    color:var(--ame-muted);
    font-size:.85rem;
}

.kpi-card > strong{

    display:block;
    margin-top:var(--ame-space-2);
    color:var(--ame-primary);
    font-size:1.5rem;
}

.empty-state{

    padding:var(--ame-space-5);
    border:1px dashed #b8c2d1;
    border-radius:10px;
    background:#f8fafc;
    color:var(--ame-muted);
    text-align:center;
}

.export-group{

    display:inline-flex;
    align-items:center;
    gap:6px;
    min-width:0;
}

.export-group > span:first-child{

    color:var(--ame-muted);
    font-size:.82rem;
    font-weight:700;
    white-space:nowrap;
}

.export-group .btn,
.export-group .stores-btn{

    min-height:44px !important;
    padding:8px 12px !important;
}

.numeric,
td[data-type="number"]{

    text-align:right;
    font-variant-numeric:tabular-nums;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width:1199px){
    .erp-kpi-grid,.erp-filter-panel{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:600px){
    .page-shell,.stores-page,.erp-page{padding:10px}
    .page-header{display:grid;grid-template-columns:1fr;gap:12px}
    .page-header .action-toolbar,.page-header .stores-actions{display:grid;grid-template-columns:1fr;width:100%}
    .page-header :is(.btn,.stores-btn){width:100%}
    .content-card{padding:14px}
    .erp-page-header{display:grid;grid-template-columns:1fr}
    .erp-page-header .stores-actions,.erp-page-header .action-toolbar{display:grid;grid-template-columns:1fr;width:100%}
    .erp-page-header :is(.btn,.stores-btn){width:100%;white-space:normal!important}
    .erp-kpi-grid,.erp-filter-panel{grid-template-columns:1fr;gap:12px}
    .erp-kpi-grid>.kpi-card{min-height:104px}
    .erp-filter-panel{padding:14px}
    .erp-content-card{padding:14px}
    .erp-confirmation-modal{padding:16px}
    .form-grid{grid-template-columns:1fr}
    .form-grid>button{justify-self:stretch;width:100%}
    .stepper{gap:8px;padding-bottom:6px}
    .stepper>span{min-width:max-content}
}

/* The Daily Progress desktop table consolidates operational states so Work Done
   can use the remaining width. Mobile cards retain their existing structure. */
@media (min-width:1201px){

    .desktop-progress-table{

        table-layout:fixed;
    }

    .desktop-progress-table th:nth-child(1),
    .desktop-progress-table td:nth-child(1){

        width:100px;
    }

    .desktop-progress-table th:nth-child(2),
    .desktop-progress-table td:nth-child(2){

        width:180px;
    }

    .desktop-progress-table th:nth-child(3),
    .desktop-progress-table td:nth-child(3){

        width:auto;
    }

    .desktop-progress-table th:nth-child(4),
    .desktop-progress-table td:nth-child(4),
    .desktop-progress-table th:nth-child(5),
    .desktop-progress-table td:nth-child(5){

        width:120px;
    }

    .desktop-progress-table th:nth-child(4),
    .desktop-progress-table th:nth-child(5){

        white-space:normal;
        line-height:1.25;
    }

    .desktop-progress-table th:nth-child(6),
    .desktop-progress-table td:nth-child(6){

        width:145px;
    }

    .desktop-progress-table th:nth-child(7),
    .desktop-progress-table td:nth-child(7){

        width:190px;
    }

    .desktop-progress-table td.photos-cell,
    .desktop-progress-table td.progress-status-cell{

        white-space:nowrap;
    }

    .desktop-progress-table td.photos-cell{

        padding-left:8px !important;
        padding-right:8px !important;
    }

    .desktop-progress-table .progress-status-primary{

        margin-bottom:8px;
        font-weight:700;
        color:var(--ame-primary);
        white-space:normal;
        overflow-wrap:anywhere;
    }

    .desktop-progress-table .progress-status-meta{

        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:6px;
    }

    .desktop-progress-table .tag{

        min-width:112px !important;
        max-width:none !important;
        padding:6px 14px !important;
        white-space:nowrap !important;
        overflow-wrap:normal;
    }

    .desktop-progress-table td.progress-action-cell{

        padding-left:18px !important;
        white-space:nowrap;
    }

    .desktop-progress-table td.progress-action-cell form{

        margin-left:10px;
    }
}

@media (max-width:900px){

    :root{

        --ame-button-gap:10px;
    }

    .action-group{

        flex-wrap:wrap !important;
        min-width:0;
    }

    .mobile-progress-card .card-body,
    .progress-mobile-body{

        padding:18px !important;
    }

    .mobile-progress-card .card-body{

        row-gap:18px !important;
    }

    .jobcard-mobile .mobile-row{

        padding-top:14px !important;
        padding-bottom:14px !important;
    }

    .progress-mobile-card .progress-field{

        margin-bottom:18px;
    }

    .actions > .btn,
    .actions > .stores-btn,
    .actions > form,
    .action-group > .btn,
    .action-group > .stores-btn,
    .action-group > form,
    .mobile-actions > .btn,
    .mobile-actions > .stores-btn,
    .mobile-actions > form,
    .progress-actions > .btn,
    .progress-actions > .stores-btn,
    .progress-actions > form,
    .gallery-actions > .btn,
    .gallery-actions > .stores-btn,
    .gallery-actions > form,
    .stores-actions > .btn,
    .stores-actions > .stores-btn,
    .stores-actions > form,
    .sticky-post > .btn,
    .sticky-post > .stores-btn,
    .sticky-post > form,
    .card-footer > .btn,
    .card-footer > .stores-btn,
    .card-footer > form{

        flex:1 1 160px !important;
    }

    .actions > form > .btn,
    .actions > form > .stores-btn,
    .action-group > form > .btn,
    .action-group > form > .stores-btn,
    .mobile-actions > form > .btn,
    .mobile-actions > form > .stores-btn,
    .progress-actions > form > .btn,
    .progress-actions > form > .stores-btn,
    .gallery-actions > form > .btn,
    .gallery-actions > form > .stores-btn,
    .stores-actions > form > .btn,
    .stores-actions > form > .stores-btn,
    .sticky-post > form > .btn,
    .sticky-post > form > .stores-btn,
    .card-footer > form > .btn,
    .card-footer > form > .stores-btn{

        width:100% !important;
    }

    .wrapper{

        display:block;

    }

    .sidebar{

        position:relative;

        width:100%;

        height:auto;

        padding:12px;

        overflow-x:auto;

        white-space:nowrap;

    }

    .sidebar-title{

        display:none;

    }

    .sidebar a{

        display:inline-block;

        padding:8px 12px;

        margin-right:6px;

        font-size:13px;

    }

    .content{

        margin-left:0;

        width:100%;

        padding:12px;

    }

    .table-responsive{

        width:100%;

        overflow-x:auto;

        -webkit-overflow-scrolling:touch;

    }

    .table-responsive table{

        min-width:900px;

    }

    table th,
    table td{

        padding:10px;

        font-size:13px;

    }

}

/* Mobile form density and actions. Desktop declarations remain unchanged. */
@media (max-width:768px){

    :root{

        --ame-button-height:46px;
        --ame-button-padding:10px 14px;
    }

    .export-group{

        display:grid;
        grid-template-columns:auto minmax(0,1fr) minmax(0,1fr);
        width:100%;
    }

    .export-group .btn,
    .export-group .stores-btn{

        width:100%;
    }

    form .form-group,
    form .stores-field{

        margin-bottom:12px !important;
    }

    form .section{

        margin-top:22px !important;
        margin-bottom:22px !important;
        padding-top:16px !important;
    }

    form .section-title{

        margin-bottom:14px !important;
        padding-bottom:7px !important;
    }

    form .stores-panel,
    form .entry-card,
    .card:has(> form),
    .page-card:has(> form){

        padding:14px !important;
    }

    form:has(> .actions),
    form:has(> .sticky-post){

        scroll-padding-bottom:88px;
        padding-bottom:calc(72px + env(safe-area-inset-bottom));
    }

    form > .actions,
    form > .sticky-post{

        position:sticky;
        bottom:0;
        z-index:100;
        display:flex !important;
        flex-flow:row wrap !important;
        gap:8px !important;
        margin:16px 0 0 !important;
        padding:10px !important;
        padding-bottom:calc(10px + env(safe-area-inset-bottom)) !important;
        background:rgba(255,255,255,.97);
        border-top:1px solid #dbe3ec;
        box-shadow:0 -4px 12px rgba(0,0,0,.08);
    }

    form > .actions > .btn,
    form > .actions > .stores-btn,
    form > .sticky-post > .btn,
    form > .sticky-post > .stores-btn{

        flex:1 1 calc(50% - 4px) !important;
        height:46px !important;
        min-height:46px !important;
        max-height:48px !important;
        padding:8px 14px !important;
    }
}

/* Shared page heading and action controls */
.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-heading h1,.page-heading h2{margin:0}
.action-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.action-toolbar form{margin:0}
.action-toolbar .btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;white-space:normal;text-align:center}
.action-toolbar.compact .btn{min-height:38px}
.permission-matrix{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.permission-option{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:12px;border:1px solid #d9e0ea;border-radius:9px}
.permission-option span,.permission-option strong,.permission-option small{display:block;min-width:0;overflow-wrap:anywhere}
.permission-option small{color:#667085}
.library-access-groups{display:grid;gap:16px}
.library-access-group{min-width:0;margin:0;padding:14px;border:1px solid #c9d4e3;border-radius:10px;background:#f8fafc}
.library-mother-folder{margin-bottom:12px;border-color:#7893b8;background:#eaf1fb}
.library-mother-folder strong{color:#0b2e75;font-size:1rem}
.library-child-folder{margin-left:min(calc(var(--folder-depth,0) * 14px),42px);background:#fff}
.segment-permission-option{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
.segment-access-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.segment-access-actions label{display:flex;align-items:center;gap:6px;white-space:nowrap}
.audit-details{min-width:220px;overflow-wrap:anywhere}

@media(max-width:900px){.permission-matrix{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.page-heading,.action-toolbar,.action-toolbar .btn,.action-toolbar form,.action-toolbar form .btn{width:100%}.permission-matrix{grid-template-columns:1fr}.segment-permission-option{grid-template-columns:1fr}.segment-access-actions{justify-content:flex-start;padding-top:8px}}

.user-card-grid>[data-user]{display:flex}
.user-card{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;padding:16px;border:1px solid #d9e0ea;border-radius:9px;background:#fff}
.user-card-main{display:grid;gap:4px;min-width:0}
.user-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0}
.user-card-heading strong,.user-card-email,.user-card-role{min-width:0;overflow-wrap:anywhere;word-break:break-word}
.user-card-heading .badge{flex:0 0 auto}
.user-card-actions{align-items:stretch;margin-top:auto;padding-top:16px}
.user-card-actions form{display:flex}
.user-card-actions .btn{height:100%;min-height:44px;white-space:normal;line-height:1.2}
.user-page-actions{gap:10px}
@media(max-width:600px){
    .user-card-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
    .user-card-actions>*{width:100%}
    .user-card-actions .btn{width:100%}
}

.identity-register{display:grid;gap:14px;margin-top:16px}.identity-card{border:1px solid var(--ame-border);border-radius:12px;padding:16px;background:#fff}.identity-options{display:flex;flex-wrap:wrap;gap:8px 16px}.identity-options label{min-height:44px;display:flex;align-items:center;gap:8px}.identity-options input{width:20px;height:20px}.section-heading{margin-bottom:16px}
@media(max-width:600px){.identity-card{padding:14px}.identity-options{display:grid;grid-template-columns:1fr}.identity-card .form-grid>*{min-width:0;width:100%}}
@media(max-width:380px){.user-card-actions{grid-template-columns:1fr}}

/* Module navigation */
.sidebar{
    width:220px;
    padding:14px 12px;
    white-space:normal;
    overscroll-behavior:contain;
}

.content{
    box-sizing:border-box;
    min-width:0;
    margin-left:220px;
    width:calc(100% - 220px);
}

.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;padding:16px 18px;border:1px solid var(--ame-border);border-radius:12px;background:var(--ame-surface);box-shadow:var(--ame-shadow)}
.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand img{width:auto;height:44px}.brand-title{color:var(--ame-primary);font-size:16px;font-weight:700}.brand-sub,.user,.user-role{color:var(--ame-muted);font-size:12.8px}.user{text-align:right}.user-name{color:var(--ame-primary);font-size:14px;font-weight:700}.page-card{padding:18px}.footer{margin-top:32px;padding:16px;color:var(--ame-muted);font-size:12.8px;line-height:1.4;text-align:center}

.sidebar-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:44px;
    padding:4px 8px 12px;
    border-bottom:1px solid rgba(255,255,255,.18);
}

.sidebar-product{
    font-size:1rem;
    font-weight:800;
    letter-spacing:.04em;
}
.sidebar-tenant{display:block;margin-top:2px;color:rgba(255,255,255,.78);font-size:12.8px;font-weight:500;overflow-wrap:anywhere}
.sidebar-search,.sidebar-footer{display:none}

.sidebar-close,.sidebar-toggle,.sidebar-scrim{
    display:none;
}

.sidebar-dashboard,.nav-group summary,.nav-group-items a{
    display:flex !important;
    align-items:center;
    gap:9px;
    box-sizing:border-box;
    width:100%;
    min-height:44px;
    border:0;
    border-radius:7px;
    color:#fff;
    font-size:.84rem;
    line-height:1.25;
    text-decoration:none;
}

.sidebar-dashboard,.nav-group-items a{
    margin-right:0 !important;
    white-space:normal;
}

.sidebar-dashboard .nav-label,.nav-group-items a>span:last-child{
    min-width:0;
    overflow-wrap:break-word;
}

.sidebar-dashboard{
    margin:12px 0 7px;
    padding:8px 10px;
}

.sidebar-groups{
    display:grid;
    gap:4px;
}

.nav-group{
    margin:0;
}

.nav-group summary{
    padding:8px 10px;
    cursor:pointer;
    list-style:none;
    font-weight:700;
    user-select:none;
}

.nav-group summary::-webkit-details-marker{display:none}
.nav-group summary::marker{content:""}
.nav-group summary:hover,.nav-group summary:focus-visible,
.sidebar-dashboard:hover,.sidebar-dashboard:focus-visible,
.nav-group-items a:hover,.nav-group-items a:focus-visible{
    color:#fff;
    background:#143d92;
    outline:2px solid transparent;
}

.nav-group.active>summary,.sidebar-dashboard.active{
    background:rgba(255,255,255,.13);
}

.nav-icon{
    display:inline-flex;
    flex:0 0 26px;
    align-items:center;
    justify-content:center;
    min-height:22px;
    border-radius:5px;
    background:rgba(255,255,255,.12);
    font-size:.64rem;
    font-weight:800;
    letter-spacing:.02em;
}

.nav-group-label{flex:1;min-width:0}
.nav-chevron{font-size:1rem;transition:transform .18s ease}
.nav-group[open]>summary .nav-chevron{transform:rotate(180deg)}
.nav-group-items{display:grid;gap:2px;padding:2px 0 6px 13px}
.nav-group-items a{padding:7px 9px}
.nav-group-items a.active{
    background:#fff;
    color:#0b2e75;
    font-weight:700;
}
.nav-group-items a.active::before,.sidebar-footer a.active::before{content:"Current";position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.nav-group-items a.active .nav-icon{background:#dce6f7}
.session-group{margin-top:5px;border-top:1px solid rgba(255,255,255,.16);padding-top:5px}

@media(max-width:900px){
    body{overflow-x:hidden}
    .content{
        margin-left:0 !important;
        width:100% !important;
        min-width:0;
        padding:12px !important;
    }
    .sidebar{
        position:fixed !important;
        inset:0 auto 0 0 !important;
        z-index:1300 !important;
        display:flex !important;
        flex-direction:column;
        width:min(88vw,336px) !important;
        height:100dvh !important;
        padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)) !important;
        overflow-y:hidden !important;
        overflow-x:hidden !important;
        white-space:normal !important;
        transform:translateX(-104%);
        transition:transform .2s ease;
        box-shadow:8px 0 24px rgba(0,0,0,.24);
    }
    body.sidebar-open{overflow:hidden!important;touch-action:none}
    .sidebar-header{position:sticky;top:0;z-index:2;flex:0 0 auto;background:#0b2e75}
    .sidebar-search{display:grid;position:sticky;top:0;z-index:2;flex:0 0 auto;gap:5px;padding:10px 4px;background:#0b2e75}
    .sidebar-search label{color:#fff;font-size:14px;font-weight:700}
    .sidebar-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
    .sidebar-search input,.sidebar-search button,.sidebar-search-empty button{box-sizing:border-box;min-height:44px;border:1px solid rgba(255,255,255,.5);border-radius:8px;padding:8px 10px;font-size:14px}
    .sidebar-search button,.sidebar-search-empty button{background:#fff;color:#0b2e75;font-weight:700}
    .sidebar-body{display:block;flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;padding:2px 0 10px;overscroll-behavior:contain}
    .sidebar-footer{display:grid;position:sticky;bottom:0;z-index:2;flex:0 0 auto;gap:2px;padding:8px 0 0;border-top:1px solid rgba(255,255,255,.18);background:#0b2e75}
    .sidebar-footer a{display:flex;position:relative;align-items:center;gap:9px;box-sizing:border-box;min-height:44px;padding:8px 10px;border-radius:7px;color:#fff;font-size:14px;text-decoration:none}
    .sidebar-footer a:hover,.sidebar-footer a:focus-visible,.sidebar-footer a.active{background:#fff;color:#0b2e75}
    .sidebar-footer a.active .nav-icon{background:#dce6f7}
    .sidebar-search-empty{margin:10px 4px;padding:14px;border:1px solid rgba(255,255,255,.35);border-radius:10px;color:#fff;font-size:14px}
    .sidebar-search-empty button{display:block;width:100%;margin-top:10px}
    .nav-group[hidden]{display:none!important}
    .sidebar-open .sidebar{transform:translateX(0)}
    .sidebar-close{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        width:44px;
        height:44px;
        border:0;
        border-radius:7px;
        background:rgba(255,255,255,.13);
        color:#fff;
        font-size:1.6rem;
    }
    .sidebar-toggle{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        gap:7px;
        min-height:44px;
        padding:8px 12px;
        border:1px solid #b8c2d1;
        border-radius:8px;
        background:#fff;
        color:#0b2e75;
        font-weight:700;
    }
    .sidebar-scrim{
        position:fixed;
        inset:0;
        z-index:1250;
        border:0;
        background:rgba(18,32,54,.52);
    }
    .sidebar-open .sidebar-scrim{display:block}
    .topbar{display:grid;grid-template-columns:auto 1fr;align-items:center}
    .topbar .user{grid-column:1/-1}
    .nav-group summary,.sidebar-dashboard,.nav-group-items a{position:relative;min-height:44px;padding-left:16px;padding-right:16px;font-size:14px}
    .nav-group-items{padding-left:13px}
    .nav-group-items a>span:last-child{min-width:240px}
}

@media(max-width:480px){
    .topbar{
        grid-template-columns:minmax(0,1fr);
        gap:12px;
        padding:14px;
    }
    .topbar .brand{
        grid-column:1;
        grid-row:1;
        width:100%;
    }
    .topbar .brand>div{
        min-width:0;
    }
    .topbar .brand-title,
    .topbar .brand-sub{
        overflow-wrap:break-word;
        word-break:normal;
    }
    .topbar .sidebar-toggle{
        grid-column:1;
        grid-row:2;
        justify-self:start;
    }
    .topbar .user{
        grid-column:1;
        grid-row:2;
        align-self:center;
        justify-self:end;
        min-width:0;
        max-width:calc(100% - 100px);
    }
}

@media(max-width:600px){
    html,body,.wrapper,.content,.page-shell,.erp-page,.stores-page{max-width:100%;min-width:0;overflow-wrap:anywhere}
    .content-card,.erp-card,.stores-panel,.page-card{max-width:100%;min-width:0}
    .page-header,.stores-head{min-width:0;flex-wrap:wrap}
    .page-header>*,.stores-head>*{min-width:0;max-width:100%}
    .quality-plan-table{display:none}
    .quality-plan-cards{display:grid;gap:12px}
    .quality-plan-card{min-width:0;padding:14px;border:1px solid var(--ame-border);border-radius:10px;background:#fff;outline-offset:3px}
    .quality-plan-card dl{display:grid;gap:8px;margin:0}
    .quality-plan-card dl>div{display:grid;grid-template-columns:minmax(88px,.35fr) minmax(0,1fr);gap:10px;align-items:start}
    .quality-plan-card dt{color:var(--ame-muted);font-weight:700}
    .quality-plan-card dd{min-width:0;margin:0;overflow-wrap:break-word;word-break:normal}
    .item-governance-actions{display:grid!important;grid-template-columns:1fr;width:100%;max-width:100%;min-width:0}
    .item-governance-actions>.stores-btn,.item-governance-actions>.item-lifecycle-form{flex:1 1 100%!important;width:100%;max-width:100%;min-width:0}
    .item-lifecycle-form,.item-lifecycle-form label,.item-lifecycle-form :is(input,button){width:100%;max-width:100%;min-width:0}
    .item-lifecycle-form{display:grid;grid-template-columns:1fr;align-items:stretch}
    .item-lifecycle-form .item-lifecycle-confirm{display:flex;width:100%;min-height:44px}
    .item-lifecycle-form .item-lifecycle-confirm input{flex:0 0 20px;width:20px}
}

summary{min-height:44px;align-content:center}

@media print{
    .sidebar,.sidebar-scrim,.sidebar-toggle,.topbar,.footer,.transfer-detail-actions{display:none!important}
    .content{margin:0!important;width:100%!important;padding:0!important}
    body{background:#fff}
}
.environment-banner{
background:#fff3cd;
border:2px solid #8a5a00;
border-radius:10px;
color:#4a3300;
font-weight:800;
letter-spacing:.02em;
margin:0 0 14px;
padding:10px 14px;
text-align:center;
overflow-wrap:break-word;
}
.login-environment-banner{
left:16px;
margin:0;
position:fixed;
right:16px;
top:16px;
z-index:10;
}
@media(max-width:480px){
.environment-banner{font-size:.85rem;padding:9px 10px}
.login-environment-banner{left:10px;right:10px;top:10px}
}
.notification-attention {
  align-items: center;
  background: #fff7d6;
  border: 1px solid #d7a72f;
  border-left: .35rem solid #b97800;
  border-radius: .65rem;
  display: flex;
  gap: .75rem 1rem;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: .75rem 1rem;
}
.notification-attention div { display: grid; gap: .15rem; min-width: 0; }
.notification-attention span { overflow-wrap: anywhere; }
.notification-attention a { flex: 0 0 auto; font-weight: 700; }
.notification-attention-actions {
  align-items: center;
  display: flex !important;
  flex: 0 0 auto;
  gap: .75rem !important;
}
.notification-read-all {
  background: #173d77;
  border: 0;
  border-radius: .45rem;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: .55rem .8rem;
}
.notification-read-all:disabled { cursor: wait; opacity: .65; }
@media (max-width: 640px) {
  .notification-attention { align-items: flex-start; flex-direction: column; }
  .notification-attention-actions { flex-direction: column; width: 100%; }
  .notification-attention-actions > * { justify-content: center; text-align: center; width: 100%; }
}
/* Report Centre: compact, permission-aware report cards grouped by business area. */
.report-centre-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px;width:100%;min-width:0}.report-centre-layout>main,.report-centre-layout>nav,.report-centre-layout .content-card{min-width:0;max-width:100%}.report-centre-layout>main{display:grid;gap:18px}.report-centre-nav{align-self:start;display:grid;gap:4px;padding:14px;position:sticky;top:16px}.report-centre-nav a{min-height:44px;display:flex;align-items:center;padding:8px 12px;border-radius:8px;font-weight:700;text-decoration:none}.report-centre-nav a:hover{background:var(--ame-nav-bg-elevated,#edf3f1)}
.report-centre-filters{display:grid;grid-template-columns:minmax(260px,2fr) minmax(180px,1fr) auto;gap:12px;align-items:end}.report-centre-filters label{min-width:0}.report-centre-filters input,.report-centre-filters select{width:100%}.report-filter-actions{display:flex;gap:8px;align-items:center}.report-groups{display:grid;gap:18px}.report-group{padding:18px}.report-group-heading{display:flex;justify-content:space-between;gap:16px;margin-bottom:14px}.report-group-heading h2{margin:0 0 4px}.report-group-heading p{margin:0;color:var(--ame-muted,#64727c)}.page-eyebrow{margin:0 0 4px;color:var(--ame-nav-accent,#0f6b70);font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.report-subgroup{display:grid;gap:10px}.report-subgroup+.report-subgroup{margin-top:20px;padding-top:18px;border-top:1px solid var(--ame-border,#dce2e6)}.report-subgroup-heading h3{margin:0 0 3px;font-size:16px}.report-subgroup-heading p{margin:0;color:var(--ame-muted,#64727c);font-size:13px}.report-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.report-link-card{display:flex;min-width:0;min-height:224px;flex-direction:column;gap:8px;padding:15px;border:1px solid var(--ame-border,#dce2e6);border-radius:10px;background:#fff}.report-link-card.is-favourite{border-color:#94c4bf;background:#fbfefd}.report-link-card h3{margin:0;font-size:16px}.report-link-card h3 a{color:var(--ame-primary,#0b2e75);text-decoration:none}.report-link-card h3 a:hover{text-decoration:underline}.report-link-card>p{margin:0;color:var(--ame-muted,#64727c);font-size:13px;line-height:1.45}.report-card-meta{display:flex;min-width:0;justify-content:space-between;gap:8px;color:var(--ame-muted,#64727c);font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.report-card-meta span{overflow-wrap:anywhere}.report-favourite-mark{color:var(--ame-nav-accent,#0f6b70)}.report-card-formats{margin-top:auto;color:var(--ame-muted,#64727c);font-size:12px;font-weight:700}.report-card-actions{display:flex;gap:8px;flex-wrap:wrap}.report-card-actions form{margin:0}.report-card-actions .btn{min-height:40px;padding:8px 12px}.report-save-view{border-top:1px solid var(--ame-border,#dce2e6);font-size:13px}.report-save-view summary{min-height:40px;color:var(--ame-primary,#0b2e75);cursor:pointer;font-weight:700}.report-save-form,.saved-report-row,.saved-report-row form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.report-save-form{margin-top:4px}.report-save-form label{flex:1 1 130px}.report-save-form input{width:100%}.saved-report-row{justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border,#dfe5ee)}.saved-report-row input,.saved-report-row select,.report-save-form input{min-height:44px}.report-actions{display:flex;gap:8px;flex-wrap:wrap}.report-actions form{margin:0}
@media(max-width:1199px){.report-centre-layout{grid-template-columns:1fr}.report-centre-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible;position:static}.report-centre-nav a{justify-content:center;text-align:center;white-space:normal}.report-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.report-centre-filters{grid-template-columns:1fr}.report-centre-filters,.report-centre-filters label,.report-filter-actions{width:100%}.report-filter-actions>*{flex:1 1 0;text-align:center}.report-centre-layout{gap:10px}.report-centre-nav{display:grid;grid-template-columns:1fr 1fr;overflow:visible;padding:10px}.report-centre-nav a{justify-content:center;text-align:center;white-space:normal}.report-group{padding:14px}.report-card-grid{grid-template-columns:1fr}.report-link-card{min-height:0}.report-card-actions{display:grid;grid-template-columns:1fr 1fr}.report-card-actions .btn{width:100%}.saved-report-row{align-items:stretch;flex-direction:column}}

/* VUI-AME-01 premium flat visual authority. */
:root{--ame-nav-bg:#f7f7f4;--ame-nav-bg-elevated:#edf3f1;--ame-nav-text:#1f2933;--ame-nav-muted:#667085;--ame-nav-border:#d8dde0;--ame-nav-active-bg:#e4f0ef;--ame-nav-active-text:#123f45;--ame-nav-accent:#0f6b70;--ame-bg:#f3f5f6;--ame-text:#23313b;--ame-muted:#64727c;--ame-border:#dce2e6;--ame-shadow:none}
body{background:var(--ame-bg);color:var(--ame-text);font:400 14px/1.5 Arial,sans-serif}
h1,.stores-head h1,.erp-head h1,.main-dashboard-header h1{font-size:clamp(22px,2.2vw,28px);line-height:1.2;font-weight:700}
h2,.erp-section-heading h2{font-size:18px;line-height:1.3;font-weight:700}
h3,.card-title,.stores-card-title{font-size:16px;line-height:1.35;font-weight:700}
.help,.helper-text,.supporting-text,.page-subtitle{font-size:12.8px;line-height:1.4;color:var(--ame-muted)}
.sidebar{background:var(--ame-nav-bg)!important;color:var(--ame-nav-text)!important;border-right:1px solid var(--ame-nav-border);box-shadow:none!important}
.sidebar-header{border-color:var(--ame-nav-border)}.sidebar-tenant,.sidebar-title{color:var(--ame-nav-muted)!important;opacity:1}
.sidebar-dashboard,.nav-group summary,.nav-group-items a,.sidebar-footer a{color:var(--ame-nav-text)!important}
.nav-icon{flex-basis:28px;width:28px;min-height:28px;background:var(--ame-nav-bg-elevated);border:1px solid var(--ame-nav-border)}
.nav-group summary:hover,.nav-group summary:focus-visible,.sidebar-dashboard:hover,.sidebar-dashboard:focus-visible,.nav-group-items a:hover,.nav-group-items a:focus-visible,.sidebar-footer a:hover,.sidebar-footer a:focus-visible{background:var(--ame-nav-bg-elevated)!important;color:var(--ame-nav-text)!important}
.nav-group-items a.active,.sidebar-dashboard.active,.sidebar-footer a.active{position:relative;border-left:3px solid var(--ame-nav-accent);background:var(--ame-nav-active-bg)!important;color:var(--ame-nav-active-text)!important}
.nav-group-items a.active .nav-icon,.sidebar-dashboard.active .nav-icon,.sidebar-footer a.active .nav-icon{background:#d5e8e6;border-color:#a9ceca;color:var(--ame-nav-active-text);font-weight:800}
.nav-group.active>summary{background:var(--ame-nav-bg-elevated)}.session-group,.sidebar-footer{border-color:var(--ame-nav-border)!important}
.topbar{padding:16px;border:1px solid var(--ame-border);border-radius:12px;background:#fff;box-shadow:none!important}.brand img{height:42px}.brand-title,.user-name{color:var(--ame-primary)}
:where(.page-card,.card,.stores-panel,.erp-content-card,.kpi-card,.erp-kpi-card,.stat-card,.inventory-kpi,.manufacturing-card,.manufacturing-action-cards>a,.manufacturing-kpis article,.summary-strip article,.settings-search-panel,.settings-category,.operational-card,.media-card,.record-hero,.library-hero,.library-record-hero){border:1px solid var(--ame-border)!important;border-radius:12px!important;background:#fff!important;box-shadow:none!important;transform:none!important}
:where(.page-card,.stores-panel,.erp-content-card){padding:18px}
:where(.page-card,.card,.stores-panel,.erp-content-card,.stat-card,.inventory-kpi,.manufacturing-card,.manufacturing-action-cards>a):hover{transform:none!important;box-shadow:none!important}
.stat-card,.inventory-kpi,.erp-kpi-grid>.kpi-card,.erp-kpi-card,.manufacturing-kpis article,.report-kpis .kpi-card{display:flex;min-height:128px;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:16px}
.stat-card :is(.stat-label,.stat-value),.inventory-kpi :is(span,strong),.erp-kpi-card :is(span,strong),.manufacturing-kpis article :is(span,strong),.report-kpis .kpi-card :is(span,strong,p){text-align:center}
.erp-empty-state,.empty-state{display:grid;place-content:center;min-height:160px;max-width:520px;margin-inline:auto;text-align:center}
.btn:not(.btn-close),.stores-btn,.search-btn,.btn-delete{box-sizing:border-box;max-width:100%;min-width:0;min-height:44px;height:auto;border-radius:8px;padding:10px 16px;line-height:1.25;white-space:normal!important;overflow-wrap:normal;word-break:normal;text-align:center}
.stores-actions,.actions,.action-group,.sticky-post{min-width:0}.stores-actions>*,.actions>*,.action-group>*,.sticky-post>*{max-width:100%;min-width:0}
.stores-table :is(a,button,.btn,.stores-btn),.erp-table :is(a,button,.btn,.stores-btn){max-width:100%;min-width:0;white-space:normal!important;overflow-wrap:normal;word-break:normal}
.status{max-width:100%;white-space:normal!important;text-align:center;overflow-wrap:normal!important;word-break:normal!important}
.repeat-add-actions{display:flex;align-items:center;justify-content:flex-end;gap:.65rem;flex-wrap:wrap;margin-top:.85rem;padding-top:.75rem;border-top:1px solid var(--ame-border)}
.repeat-add-actions small{color:var(--ame-muted)}
.app-search-trigger{display:inline-flex;align-items:center;justify-content:center;gap:.55rem;box-sizing:border-box;min-width:0;min-height:42px;max-width:20rem;padding:.55rem .75rem;border:1px solid #b8c2d1;border-radius:9px;background:#f8fafb;color:#23313b;font:inherit;font-weight:700;cursor:pointer}.app-search-trigger>span:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.app-search-trigger kbd,.app-search-dialog kbd{padding:.12rem .35rem;border:1px solid #cbd3da;border-radius:5px;background:#fff;color:#596873;font:600 .72rem/1.4 Arial,sans-serif;box-shadow:0 1px 0 #cbd3da}.app-search-overlay{position:fixed;inset:0;z-index:2000;display:grid;place-items:start center;padding:clamp(3.5rem,10vh,7rem) 1rem 1rem;background:rgba(18,32,54,.52)}.app-search-overlay[hidden]{display:none!important}.app-search-open{overflow:hidden}.app-search-dialog{box-sizing:border-box;width:min(42rem,100%);max-height:min(44rem,82vh);display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;overflow:hidden;border:1px solid #cbd3da;border-radius:14px;background:#fff;box-shadow:0 24px 60px rgba(20,34,54,.28)}.app-search-dialog>header{display:flex;justify-content:space-between;gap:1rem;padding:1rem 1rem .7rem}.app-search-dialog h2,.app-search-dialog p{margin:0}.app-search-dialog header p{color:var(--ame-muted);font-size:.86rem}.app-search-close{width:42px;height:42px;flex:0 0 42px;border:1px solid var(--ame-border);border-radius:8px;background:#fff;color:#23313b;font-size:1.5rem;cursor:pointer}.app-search-input-wrap{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.55rem;margin:0 1rem .75rem;padding:0 .75rem;border:2px solid #0f6b70;border-radius:9px}.app-search-input-wrap input{box-sizing:border-box;width:100%;min-width:0;min-height:46px;border:0;outline:0;background:transparent;font:inherit;font-size:1rem}.app-search-results{min-height:5rem;overflow:auto;padding:0 .65rem .65rem}.app-search-results a{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:center;min-height:48px;padding:.55rem .7rem;border-radius:8px;color:#23313b;text-decoration:none}.app-search-results a span{color:var(--ame-muted);font-size:.82rem;text-align:right}.app-search-results a.active,.app-search-results a:hover{background:#e4f0ef;color:#123f45}.app-search-empty{padding:1rem;text-align:center;color:var(--ame-muted)}.app-search-dialog>footer{display:flex;gap:1rem;padding:.65rem 1rem;border-top:1px solid var(--ame-border);color:var(--ame-muted);font-size:.78rem}.app-search-dialog>footer span{display:flex;align-items:center;gap:.25rem}
.stores-btn.secondary,.btn-secondary{border:1px solid #46545d;background:#fff;color:#23313b}.stores-btn.danger,.btn-danger{background:#b42318;color:#fff}
:focus-visible{outline:3px solid var(--ame-focus)!important;outline-offset:2px}
:where(.stores-table,.erp-table,.report-table) th{background:#eef2f4;color:#23313b;font-size:14px;font-weight:700}:where(.stores-table,.erp-table,.report-table) :is(th,td){padding:11px 9px}
.erp-filter-panel,.erp-filter-grid,.report-filter-grid,.gallery-filter{grid-template-columns:repeat(4,minmax(0,1fr))}
.erp-register-compact{display:grid;grid-template-columns:minmax(12rem,2fr) minmax(10rem,1fr) auto;gap:.55rem .75rem;align-items:end;margin:.6rem 0 .9rem}
.erp-register-compact>label,.erp-register-more label{display:grid;gap:.3rem;min-width:0;font-size:.86rem;font-weight:700}
.erp-register-compact :is(input,select){box-sizing:border-box;width:100%;min-width:0;min-height:40px;max-height:44px;padding:.45rem .65rem}
.erp-register-compact>.btn{min-height:40px;white-space:nowrap}.erp-register-more{grid-column:1/-1}.erp-register-more>summary{display:inline-flex;align-items:center;min-height:34px;color:#173f78;font-weight:700;cursor:pointer;padding:.15rem .3rem}
.erp-register-more>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));align-items:end;gap:.65rem;padding:.7rem;background:#f7f9fb;border:1px solid #e1e8ee;border-radius:8px}
.erp-register-more>div>.btn{justify-self:start}
@media(max-width:620px){.erp-register-compact{grid-template-columns:minmax(0,1fr) auto}.erp-register-compact>label:first-of-type{grid-column:1/-1}.erp-register-more>div{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:400px){.erp-register-more>div{grid-template-columns:1fr}}
.erp-filter-panel>label,.erp-filter-grid>label,.report-filter-grid>label,.gallery-filter>label{display:grid;gap:6px;min-width:0;width:100%}
.erp-line-editor{display:grid;grid-template-columns:minmax(0,2fr) minmax(160px,.7fr) auto;gap:12px;align-items:end;min-width:0;width:100%}
.settings-directory{grid-template-columns:repeat(4,minmax(0,1fr))}.procurement-bars i{background:#0b2e75!important}
@media(max-width:1199px) and (min-width:601px){.erp-filter-panel,.erp-filter-grid,.report-filter-grid,.gallery-filter,.settings-directory{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:901px){.sidebar{position:fixed!important;inset:0 auto 0 0!important;width:220px!important;height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important}.content{margin-left:220px!important;width:calc(100% - 220px)!important}}
@media(max-width:900px){.sidebar,.sidebar-header,.sidebar-search,.sidebar-footer{background:var(--ame-nav-bg)!important}.sidebar{box-shadow:none!important}.sidebar-search label,.sidebar-search-empty{color:var(--ame-nav-text)}.sidebar-search input{background:#fff;border-color:var(--ame-nav-border);color:var(--ame-nav-text)}.sidebar-search input::placeholder{color:var(--ame-nav-muted)}.sidebar-search button,.sidebar-search-empty button{background:var(--ame-nav-active-bg);border-color:#a9ceca;color:var(--ame-nav-active-text)}.sidebar-close{background:#fff!important;border-color:var(--ame-nav-border)!important;color:var(--ame-nav-text)!important}}
@media(max-width:900px){.stores-head,.erp-page-header{align-items:stretch}.stores-head>.stores-actions,.erp-page-header>.stores-actions{min-width:0;flex-wrap:wrap}.stores-head>.stores-actions>*{min-width:0}}
@media(max-width:900px){.topbar .app-search-trigger,.topbar .company-switcher{grid-column:1/-1;width:100%;max-width:none}.app-search-trigger kbd{display:none}.repeat-add-actions{align-items:stretch;flex-direction:column}.repeat-add-actions .stores-btn{width:100%}.app-search-dialog>footer{display:none}.app-search-results a{grid-template-columns:minmax(0,1fr)}.app-search-results a span{text-align:left}}
@media(max-width:600px){:where(.page-card,.stores-panel,.erp-content-card){padding:14px}.stat-card,.inventory-kpi,.erp-kpi-grid>.kpi-card,.erp-kpi-card,.manufacturing-kpis article,.report-kpis .kpi-card{min-height:104px}.erp-filter-panel,.erp-filter-grid,.report-filter-grid,.gallery-filter,.settings-directory{grid-template-columns:1fr}.settings-directory,.erp-line-editor,.user-access-grid{grid-template-columns:1fr}}
@media print{.sidebar,.sidebar-header,.sidebar-search,.sidebar-footer{background:#fff!important;color:#000!important}}
/* Assignment-scoped, deliberately non-financial Job Card consumption history. */
.consumption-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.consumption-summary-card{display:grid;gap:5px;min-width:0;padding:14px;border:1px solid var(--border,#dce2e6);border-radius:10px;background:#fff}.consumption-summary-card>div{display:grid;gap:2px;min-width:0}.consumption-summary-card strong,.consumption-summary-card span{overflow-wrap:anywhere}.consumption-summary-card b{color:var(--primary,#0b2e75);font-size:1.05rem}.consumption-summary-card small{color:var(--muted,#64727c)}.consumption-history-disclosure{margin-top:12px;border-top:1px solid var(--border,#dce2e6);padding-top:10px}.consumption-history-disclosure>summary{min-height:44px;display:flex;align-items:center;font-weight:700;cursor:pointer}.consumption-history-list{display:grid;gap:8px}.consumption-history-list article{display:flex;justify-content:space-between;gap:16px;padding:10px 0;border-top:1px solid var(--border,#dce2e6)}.consumption-history-list article>div{display:grid;gap:3px;min-width:0}.consumption-history-list a{min-height:44px;display:inline-flex;align-items:center}@media(max-width:900px){.consumption-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.consumption-summary-grid{grid-template-columns:1fr}.consumption-history-list article{display:grid;gap:4px}}
.consumption-correction-form{display:grid;gap:12px}.consumption-line-correction{grid-template-columns:minmax(9rem,.65fr) minmax(13rem,1fr);gap:10px!important;padding:10px;border:1px solid var(--border,#dce2e6);border-radius:9px;background:#f8fafc}.consumption-line-correction label,.consumption-correction-actions label{display:grid;gap:5px;font-weight:700}.consumption-line-correction input[type=number],.consumption-correction-actions input{width:100%;min-height:42px}.consumption-line-correction .consumption-select{grid-template-columns:22px minmax(0,1fr);align-items:center}.consumption-line-correction .consumption-select input{width:18px;height:18px;margin:0}.consumption-line-correction small,.consumption-correction-actions small{color:var(--muted,#64727c);font-weight:400}.consumption-correction-actions{display:grid;grid-template-columns:minmax(14rem,1fr) auto;align-items:end;gap:10px;padding:12px;border-top:1px solid var(--border,#dce2e6)}@media(max-width:700px){.consumption-line-correction,.consumption-correction-actions{grid-template-columns:1fr}.consumption-correction-actions .stores-btn{width:100%}}

/* Purpose-limited Accounts billing references: compact and responsive. */
.billing-reference-page,.billing-reference-page *{box-sizing:border-box;min-width:0}.billing-reference-page{display:grid;gap:16px;width:100%;max-width:100%}.billing-reference-page .filter-panel{display:grid;grid-template-columns:minmax(240px,2fr) minmax(200px,1fr) auto;gap:12px;align-items:end;max-width:100%}.billing-reference-page .filter-panel label{display:grid;gap:6px}.billing-reference-page .filter-panel :is(input,select){width:100%;max-width:100%;min-height:44px}.billing-reference-page .filter-actions{display:flex;gap:8px;flex-wrap:wrap}.billing-reference-page .table-scroll{display:block;width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.billing-reference-page table{width:100%;border-collapse:collapse}.billing-reference-page :is(th,td){padding:10px;text-align:left;vertical-align:top;overflow-wrap:anywhere}.billing-reference-page td small{display:block;margin-top:4px;color:var(--ame-muted)}.billing-reference-page td form{display:grid;gap:8px;margin-top:10px}.billing-reference-page td form :is(input,select,button){width:100%;max-width:100%;min-height:44px}@media(max-width:900px){.billing-reference-page .filter-panel{grid-template-columns:1fr}.billing-reference-page .filter-actions>*{flex:1 1 0;text-align:center}.billing-reference-page .table-scroll{overflow:visible}.billing-reference-page table,.billing-reference-page tbody,.billing-reference-page tr,.billing-reference-page td{display:block;width:100%}.billing-reference-page thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.billing-reference-page tr{display:grid;gap:0;margin-bottom:12px;padding:10px;border:1px solid var(--ame-border);border-radius:10px;background:#fff}.billing-reference-page td{display:grid;grid-template-columns:minmax(7.5rem,.38fr) minmax(0,1fr);gap:10px;border:0;padding:7px}.billing-reference-page td::before{content:attr(data-label);color:var(--ame-muted);font-weight:700}.billing-reference-page td[colspan]{display:block}}@media(max-width:600px){.billing-reference-page{gap:12px}.billing-reference-page td{grid-template-columns:1fr;gap:3px}.billing-reference-page .filter-actions{display:grid;grid-template-columns:1fr}}
/* Tenant identity is additive: the established AME palette remains the fallback. */
.brand-title,.user-name{color:var(--tenant-primary,#0b2e75)}
.company-switcher{display:grid;gap:.2rem;min-width:min(15rem,100%)}
.company-switcher label{font-size:.68rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#596579}
.company-switcher select{min-height:2.5rem;border:1px solid #cbd3df;border-radius:.65rem;background:#fff;padding:.45rem 2rem .45rem .7rem;color:#17233a;max-width:18rem}
.commercial-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(18rem,100%),1fr));gap:1rem}
.commercial-company-card{display:flex;justify-content:space-between;align-items:end;gap:1rem}
.commercial-company-card h2{margin:.7rem 0 .15rem}
.commercial-form{max-width:64rem}
.commercial-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-bottom:1.25rem}
.commercial-span{grid-column:1/-1}
.commercial-page{display:grid;align-content:start;gap:0}
.commercial-page>.stores-head{width:100%}
.commercial-form{width:min(64rem,100%)}
.commercial-form>.stores-btn{justify-self:start}
.commercial-domain-form{display:grid;grid-template-columns:minmax(16rem,1fr) auto;gap:14px;align-items:end;max-width:64rem;width:100%}
.commercial-domain-form>.stores-btn{margin:0}
.commercial-page table{width:100%;border-collapse:collapse}
.commercial-page th,.commercial-page td{padding:11px 9px;border-bottom:1px solid var(--ame-border);text-align:left;vertical-align:top}
.commercial-subscription{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:1rem}
.commercial-subscription div{display:grid;gap:.35rem;padding:1rem;border:1px solid #dde3ec;border-radius:.8rem}
.commercial-subscription span{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:#667085}
.commercial-subscription strong{font-size:1.2rem;color:var(--tenant-primary,#0b2e75)}
.setup-checklist{list-style:none;margin:0;padding:1rem;display:grid;gap:.65rem}
.setup-checklist li{display:grid;grid-template-columns:2.5rem 1fr auto;gap:.8rem;align-items:center;padding:.8rem;border:1px solid #dde3ec;border-radius:.8rem}
.setup-checklist li>span{display:grid;place-items:center;width:2.25rem;height:2.25rem;border-radius:50%;background:#eef2f7;color:#344054;font-weight:800}
.setup-checklist li.complete>span{background:#dff4ea;color:#176b4d}.setup-checklist li div{display:grid}.setup-checklist small{color:#667085}
@media(max-width:768px){.commercial-form-grid,.commercial-domain-form{grid-template-columns:1fr}.commercial-span{grid-column:auto}.commercial-form>.stores-btn,.commercial-domain-form>.stores-btn{width:100%}.commercial-company-card{align-items:stretch;flex-direction:column}.company-switcher{width:100%}.company-switcher select{max-width:none;width:100%}}

/* Shared reports: mobile-first controls that do not stretch across wide screens. */
.page-shell details.report-filter-panel.content-card{padding:0;overflow:hidden}
.page-shell details.report-filter-panel>summary{display:flex;align-items:center;min-height:46px;padding:10px 14px;cursor:pointer;color:#173f78;font-weight:800}
.page-shell details.report-filter-panel[open]>summary{border-bottom:1px solid var(--ame-border);background:#f8fafb}
.report-column-searches{grid-column:1/-1;width:100%;border:1px solid var(--ame-border,#dce2e6);border-radius:10px;background:#f8fafb;overflow:hidden}
.report-column-searches>summary{cursor:pointer;padding:10px 12px;color:#173f78;font-size:.9rem;font-weight:800}
.report-column-searches[open]>summary{border-bottom:1px solid var(--ame-border,#dce2e6)}
.report-column-search-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;padding:12px}
.report-column-search-grid label{display:grid;gap:5px;min-width:0;font-size:.82rem;font-weight:700}
.report-column-search-grid input{box-sizing:border-box;width:100%;min-width:0}
.page-shell form.report-compact-filter{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:end;width:100%;max-width:100%;margin:0;padding:12px}
.page-shell form.report-compact-filter>label{display:grid;gap:5px;min-width:0;width:100%;font-size:.86rem;font-weight:700}
.page-shell form.report-compact-filter :is(input,select){box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:42px;padding:8px 10px}
.page-shell form.report-compact-filter .report-filter-actions,.page-shell form.report-compact-filter .filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
.page-shell form.report-compact-filter .report-filter-actions>*,.page-shell form.report-compact-filter .filter-actions>*{width:100%;margin:0}
.page-shell .report-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.page-shell .report-actions>*{max-width:100%}
.page-shell .pagination{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
@media(min-width:640px){
  .page-shell form.report-compact-filter{grid-template-columns:repeat(2,minmax(0,15rem));justify-content:start;width:max-content}
  .page-shell form.report-compact-filter .report-filter-search{grid-column:span 2}
  .page-shell form.report-compact-filter .report-filter-actions,.page-shell form.report-compact-filter .filter-actions{display:flex;width:auto}
  .page-shell form.report-compact-filter .report-filter-actions>*,.page-shell form.report-compact-filter .filter-actions>*{width:auto}
}
@media(min-width:1024px){
  .page-shell form.report-compact-filter{grid-template-columns:repeat(auto-fit,minmax(11.5rem,15rem));width:100%}
  .page-shell form.report-centre-filters.report-compact-filter,.billing-reference-page form.report-compact-filter{grid-template-columns:minmax(16rem,28rem) minmax(12rem,18rem) auto;width:max-content}
}
@media(max-width:600px){.report-column-search-grid{grid-template-columns:1fr}}
/* Searchable report/entity selectors retain their native submitted select. */
.report-select-search{box-sizing:border-box;width:100%;min-width:0;min-height:42px;margin:0 0 5px;padding:8px 10px;border:1px solid #b8c2d1;border-radius:7px;background:#fff}
.report-select-search:focus{border-color:#315b92;outline:3px solid rgba(49,91,146,.14)}
.report-select-combobox{position:relative;min-width:0}
.report-select-results{position:absolute;z-index:40;top:calc(100% - 4px);left:0;right:0;max-height:17rem;overflow-y:auto;border:1px solid #aeb9c8;border-radius:8px;background:#fff;box-shadow:0 10px 24px rgba(24,39,58,.16)}
.report-select-results[hidden]{display:none}
.report-select-result{display:block;width:100%;min-height:40px;padding:9px 11px;border:0;border-bottom:1px solid #e4e8ef;background:#fff;color:#24364b;font:inherit;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.report-select-result:last-child{border-bottom:0}.report-select-result:hover,.report-select-result:focus{outline:0;background:#eaf1fb;color:#0b2e75}
.report-select-feedback{display:block;min-height:1.15em;margin-top:4px;color:#607086;font-size:.76rem;font-weight:500;line-height:1.35}
