@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* ============================================================
   Oryx Control — design tokens (CSS-only refresh, additive)
   ============================================================ */
:root {
    --ink:     #101715;   /* app background base       */
    --ink-2:   #1F342E;   /* background highlight       */
    --surface: #182620;   /* raised dark panels         */
    --line:    #385249;   /* hairline borders/dividers  */
    --paper:   #F4F2EA;   /* on-dark text / fields      */
    --card:    #FAF8F0;   /* solid cards                */
    --card-fg: #16231F;   /* text inside cards          */
    --oryx:    #D98D2B;   /* brand accent / focus       */
    --run:     #1F9D63;   /* machine running            */
    --stop:    #D64550;   /* machine stopped            */
    --attn:    #F0B443;   /* attention                  */
    --radius:  12px;
    --shadow:  0 10px 26px rgba(0,0,0,.30);
}

/* ============================================================
   ORIGINAL RULES (preserved verbatim — functional + layout)
   ============================================================ */
/* MAIN ELEMENTS */
html {
    height:100%;
}

body {
    /* background: url(https://barcodes-public.oss-ap-southeast-1.aliyuncs.com/mes/medias/home-menu-bg-overlay.svg), linear-gradient(to right bottom, #77717e, #c9a8a9); */
    /* background: url(https://barcodes-public.oss-ap-southeast-1.aliyuncs.com/mes/medias/home-menu-bg-overlay.svg), linear-gradient(to right bottom, #77717e, #c9a8a9); */
    /* background: url(https://mbcn-cdn-public.oss-cn-shenzhen.aliyuncs.com/public/SquaresMajorbird-3000x2000-v16-BC.jpg), linear-gradient(to right bottom, #77717e, #c9a8a9); */
    background: url(https://barcodes-public.oss-ap-southeast-1.aliyuncs.com/mes/medias/background-light.svg);
    background-color: #0e567e;
    overflow-x: hidden;
    background-size: cover;
    background-position: bottom center;
    height:100%;
    background-repeat: no-repeat;
}
html.home .card {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
}
img.top-logo {
    width: 65px;
    display: inline !important;
    float:left;
    margin-right: 20px;
}
img.home-logo {
    width: 200px;
}
html.home .btn-light {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border:none;
}


.mb_content {
    padding-top: 62px;
}
.mb_mobile_form .form-row, .mb_mobile_form select, .mb_mobile_form input{
    font-size:10px;
    min-height:auto
}
.mb_mobile_form button{
    padding:0;
    width:100%;
}
/* CONTROLS */
.numeric-btn {
    width:100%;
    min-height:80px;
    font-weight: bold;
    font-size:  32px;
}
.mb_hardware_controlled {
    background-color: black!important;
    color:white!important;
    font-weight: bold;
}
.numeric_counter {
    background-color: black!important;
    color:red!important;
    font-weight: bold;
    padding:5px;
    text-transform: uppercase;
}
.numeric_counter.positive {
    color:greenyellow!important;
}
.numeric_counter.large {
    padding:10px;
    font-size:25px;
}
form .row {
    min-height: 80px;
}
.mobile_only {
    display:none
}
.invisible {
    display:none!important;
}

.mb_scan_history{
    overflow-y: scroll;
    max-height: 200px;
}
button.mb_big {
    width: 100%;
    min-height: 80px;
}

.mb_history button {
    min-height: auto;
}
h1 {
    color: #2c3067;
    margin-bottom: 30px;
}
.menu-big-choice {
    min-height:500px;
    width:100%;
    height:100%;
    padding-top:30%;
}
/* .menu-back-btn {
    float:right;
    width:100px;
} */
.menu-card {
    padding:10px;
}
.loading .not_mb_loader {
    display: none;
}
.not_loading .mb_loader {
    display: none
}
.loading .mb_loader {
    display: inline-block!important
}

button.selected,
button.selected:hover,
button.selected:focus {
    background-color: black;
}

button.qc_defect_size.selected {
    color: orange!important
}

.modal-footer {
    display: inline-block;
}

/* MOBILE */

@media (max-width:600px){
    h1 {
        font-size: 30px;
    }
    #input_free {
        display:none;
    }

    .mobile_only {
        display: block
    }
}

.row.mjb-feed {
    display: inline;
    margin-left: 10px;
}

/* ============================================================
   ENHANCEMENT LAYER (visual only — placed after originals so it
   wins on equal specificity; no selectors/ids/classes added)
   ============================================================ */

/* Type + instrument-panel background */
body {
    font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--paper);
    background:
        linear-gradient(135deg, rgba(217,141,43,.10) 0%, rgba(217,141,43,0) 34%),
        linear-gradient(180deg, var(--ink-2), var(--ink) 72%, #0b1110) fixed;
    background-color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container,
.container-fluid {
    padding-left: 24px;
    padding-right: 24px;
}

/* Cards become solid, elevated instrument panels (drop translucency
   for shop-floor legibility). Text inside cards stays dark. */
.card,
html.home .card {
    background: linear-gradient(180deg, #fffdf8, var(--card));
    color: var(--card-fg);
    border: 1px solid rgba(22,35,31,.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.modal-content,
.toast {
    color: var(--card-fg);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.card .form-control,
.card label,
.card .card-body,
.card h3, .card h4, .card h5, .card h6 {
    color: var(--card-fg);
}
.card label,
.form-group label {
    font-weight: 600;
}
.card-body {
    padding: 1.1rem;
}

/* Page titles sit on the dark background */
h1 {
    color: var(--paper);
    letter-spacing: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* Buttons: more weight, softer corners, clear press + focus */
.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0;
    transition: transform .04s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-primary { background-color: var(--oryx); border-color: var(--oryx); color: #1a1205; }
.btn-primary:hover, .btn-primary:focus { background-color: #d9942f; border-color: #d9942f; color:#1a1205; }
.btn-success { background-color: var(--run); border-color: var(--run); }
.btn-danger  { background-color: var(--stop); border-color: var(--stop); }
html.home .btn-light {
    background: rgba(250,248,240,.14);
    color: var(--paper);
    border: 1px solid rgba(244,242,234,.22);
}
html.home .btn-light:hover,
html.home .btn-light:focus {
    background: rgba(250,248,240,.24);
    color: #fff;
}
.card .btn-light,
html.home .card .btn-light {
    background: #fffdf8;
    color: var(--card-fg);
    border-color: #cfd9d3;
}
.card .btn-light:hover,
.card .btn-light:focus,
html.home .card .btn-light:hover,
html.home .card .btn-light:focus {
    background: #f3eadc;
    color: var(--card-fg);
}

/* Bigger, calmer numeric keypad */
.numeric-btn {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fffdf8;
    color: var(--card-fg);
    box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
button.mb_big { border-radius: 12px; }

/* Selected state stays unmistakable */
button.selected,
button.selected:hover,
button.selected:focus {
    background-color: #000;
    color: var(--oryx);
    box-shadow: inset 0 0 0 2px var(--oryx);
}

/* Signature: the numeric readout as an instrument display */
.numeric_counter {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    letter-spacing: 0;
    border-radius: 8px;
    border: 1px solid #000;
    box-shadow: inset 0 2px 8px rgba(0,0,0,.9);
    text-shadow: 0 0 8px currentColor;
}

/* Visible keyboard focus (accessibility floor) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--oryx);
    outline-offset: 2px;
}
.form-control:focus {
    border-color: var(--oryx);
    box-shadow: 0 0 0 .2rem rgba(232,163,61,.25);
}

/* Inputs: a touch more presence */
.form-control {
    border-radius: 8px;
    min-height: 44px;
    border-color: #cfd9d3;
    background-color: #fffdf8;
    color: var(--card-fg);
}
select.form-control,
.custom-select {
    min-height: 44px;
}

/* Menu tiles feel tappable */
.menu-card {
    border-radius: var(--radius);
    transition: transform .1s ease, box-shadow .12s ease;
    overflow: hidden;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.card-img-top { border-radius: 10px 10px 0 0; }

.mb_scan_history {
    border: 1px solid #d6ded8;
    border-radius: 10px;
    background: #fffdf8;
    padding: 8px;
}

@media (max-width:600px){
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    .card-body {
        padding: .9rem;
    }
    .btn,
    button.mb_big {
        min-height: 48px;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
