/* ==========================================================================
   gems.css
   GEMS — Master Stylesheet
   
   All styles for the application live here.
   Previously these were baked into header.php (200+ lines of inline <style>).
   Now you edit ONE file. Done.
   ========================================================================== */


/* ==========================================================================
   RESET & BASE
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
}


/* ==========================================================================
   TOP HEADER
   ========================================================================== */

.top-header {
    background: #283593;
    color: #fff;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-header .title {
    font-size: 18px;
    font-weight: bold;
}

.top-header .user-info {
    font-size: 13px;
}

.top-header a {
    color: #ffeb3b;
    text-decoration: none;
    margin-left: 12px;
    font-size: 13px;
}

.top-header a:hover {
    text-decoration: underline;
}

/* Hamburger + title wrapper */
.title-wrapper {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;           /* hidden on desktop */
    margin-right: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
}


/* ==========================================================================
   LAYOUT (sidebar + content flex container)
   ========================================================================== */

.layout {
    display: flex;
    min-height: calc(100vh - 48px);
}


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

.sidebar {
    width: 220px;
    min-width: 220px;   /* #MZO — prevent flex shrink on wide content pages */
    flex-shrink: 0;     /* #MZO — sidebar must never compress */
    background: #ffffff;
    border-right: 1px solid #ddd;
    padding: 12px 0;
}

.sidebar-title {
    padding: 0 16px 8px 16px;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list li a {
    display: flex;                          /* #MZO — icon + label side by side */
    align-items: center;                    /* #MZO */
    gap: 10px;                              /* #MZO — space between icon and text */
    padding: 10px 16px;
    text-decoration: none;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-list li a:hover,
.menu-list li a.active {
    background: #e3f2fd;
    color: #0d47a1;
}

/* FA icon inside menu items                                                #MZO */
.menu-list li a i {
    font-size: 14px;
    width: 18px;                            /* fixed width keeps labels aligned */
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.menu-list li a:hover i,
.menu-list li a.active i {
    opacity: 1;
}

/* Section divider label                                                    #MZO */
.menu-section-divider {
    list-style: none;
    margin-top: 4px;
}

.menu-section-label {
    display: block;
    padding: 10px 16px 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9ca3af;
    border-top: 1px solid #eeeeee;
}

.menu-section-divider:first-of-type .menu-section-label {
    border-top: none;                       /* no top border on first section */
}


/* ==========================================================================
   CONTENT AREA
   ========================================================================== */

.content {
    flex: 1;
    padding: 16px;
    overflow-x: auto;   /* #MZO — wide tables scroll inside content, not full page */
    min-width: 0;       /* #MZO — required for flex child overflow to work correctly */
}


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

.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
    padding: 16px;
}

.card h1 {
    margin-top: 0;
    font-size: 20px;
}

.card h2 {
    margin-top: 0;
    font-size: 16px;
}

.card-narrow {
    max-width: 650px;
}


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

.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* ── Solid colour variants ── */

.btn-primary          { background: #007bff; color: #fff; }
.btn-primary:hover    { background: #0056b3; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

.btn-secondary        { background: #6c757d; color: #fff; }
.btn-secondary:hover  { background: #5a6268; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

.btn-danger           { background: #dc3545; color: #fff; }
.btn-danger:hover     { background: #bd2130; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

.btn-edit             { background: #6c757d; color: #fff; }
.btn-edit:hover       { background: #5a6268; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

.btn-green            { background: #28a745; color: #fff; }
.btn-green:hover      { background: #218838; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Amber – for warnings, approvals, "pending" actions */
.btn-warning          { background: #ffc107; color: #212529; }
.btn-warning:hover    { background: #e0a800; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #212529; }

/* Teal – for informational / view / print actions */
.btn-info             { background: #17a2b8; color: #fff; }
.btn-info:hover       { background: #117a8b; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Dark – for export, archive, or neutral strong actions */
.btn-dark             { background: #343a40; color: #fff; }
.btn-dark:hover       { background: #1d2124; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Light – subtle actions (reset, cancel) on dark backgrounds */
.btn-light            { background: #f8f9fa; color: #212529; border: 1px solid #dee2e6; }
.btn-light:hover      { background: #e2e6ea; box-shadow: 0 2px 4px rgba(0,0,0,0.1); color: #212529; }

/* Purple – for special / VIP / premium markers */
.btn-purple           { background: #6f42c1; color: #fff; }
.btn-purple:hover     { background: #5a32a3; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* ── GEMS-palette colours (matched to app header / sidebar tones) ── */

/* Indigo – matches GEMS header #283593; use for "home", branding, nav-level actions */
.btn-indigo           { background: #283593; color: #fff; }
.btn-indigo:hover     { background: #1a237e; box-shadow: 0 2px 4px rgba(0,0,0,0.25); color: #fff; }

/* Navy – deeper than indigo; strong authority actions (finalise, submit) */
.btn-navy             { background: #0d47a1; color: #fff; }
.btn-navy:hover       { background: #0a3880; box-shadow: 0 2px 4px rgba(0,0,0,0.25); color: #fff; }

/* Sky – soft blue matching sidebar hover #e3f2fd bg; gentle / read-only actions */
.btn-sky              { background: #1e88e5; color: #fff; }
.btn-sky:hover        { background: #1565c0; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Teal-deep – richer teal for service / workshop-specific actions */
.btn-teal             { background: #00897b; color: #fff; }
.btn-teal:hover       { background: #00695c; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Orange – stronger call-to-action, due dates, reminders */
.btn-orange           { background: #e65100; color: #fff; }
.btn-orange:hover     { background: #bf360c; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Amber-deep – parts pending, awaiting, on-hold states */
.btn-amber            { background: #f57c00; color: #fff; }
.btn-amber:hover      { background: #e65100; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Slate – cool-grey, cleaner neutral than secondary */
.btn-slate            { background: #546e7a; color: #fff; }
.btn-slate:hover      { background: #37474f; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Brown – workshop/parts/physical items context */
.btn-brown            { background: #6d4c41; color: #fff; }
.btn-brown:hover      { background: #4e342e; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* Pink – special flags, loyalty, female-oriented service reminders */
.btn-pink             { background: #e91e63; color: #fff; }
.btn-pink:hover       { background: #c2185b; box-shadow: 0 2px 4px rgba(0,0,0,0.2); color: #fff; }

/* ── Outline variants (transparent fill, coloured border) ── */

.btn-outline-primary  { background: transparent; color: #007bff; border: 1px solid #007bff; }
.btn-outline-primary:hover  { background: #007bff; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-danger   { background: transparent; color: #dc3545; border: 1px solid #dc3545; }
.btn-outline-danger:hover   { background: #dc3545; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-green    { background: transparent; color: #28a745; border: 1px solid #28a745; }
.btn-outline-green:hover    { background: #28a745; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-secondary { background: transparent; color: #6c757d; border: 1px solid #6c757d; }
.btn-outline-secondary:hover { background: #6c757d; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-warning  { background: transparent; color: #c68a00; border: 1px solid #ffc107; }
.btn-outline-warning:hover  { background: #ffc107; color: #212529; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-info     { background: transparent; color: #17a2b8; border: 1px solid #17a2b8; }
.btn-outline-info:hover     { background: #17a2b8; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

/* GEMS-palette outlines */
.btn-outline-indigo   { background: transparent; color: #283593; border: 1px solid #283593; }
.btn-outline-indigo:hover   { background: #283593; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-navy     { background: transparent; color: #0d47a1; border: 1px solid #0d47a1; }
.btn-outline-navy:hover     { background: #0d47a1; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-teal     { background: transparent; color: #00897b; border: 1px solid #00897b; }
.btn-outline-teal:hover     { background: #00897b; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-orange   { background: transparent; color: #e65100; border: 1px solid #e65100; }
.btn-outline-orange:hover   { background: #e65100; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-slate    { background: transparent; color: #546e7a; border: 1px solid #546e7a; }
.btn-outline-slate:hover    { background: #546e7a; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-pink     { background: transparent; color: #e91e63; border: 1px solid #e91e63; }
.btn-outline-pink:hover     { background: #e91e63; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.btn-outline-purple   { background: transparent; color: #6f42c1; border: 1px solid #6f42c1; }
.btn-outline-purple:hover   { background: #6f42c1; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

/* ── Size variants ── */

/* Small – tight table cells, badge-like actions */
.btn-sm {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 3px;
}

/* Large – primary page CTAs, hero actions */
.btn-lg {
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 5px;
}

/* ── Layout helpers ── */

/* Full-width block button (e.g. login, confirm modal) */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-right: 0;
}

/* Square icon-only button (use with a single emoji or icon font) */
.btn-icon {
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1;
    min-width: 30px;
    text-align: center;
}

/* ── State: disabled ── */

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}


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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

th, td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    vertical-align: middle;
}

th {
    background: #f1f1f1;
    text-align: left;
}

/* Alternating row colours */
table tbody tr:nth-child(odd)  { background-color: #ffffff; }
table tbody tr:nth-child(even) { background-color: #f6f8fb; }
table tbody tr:hover           { background-color: #eef3ff; }

/* Inline action buttons inside table cells */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    display: inline-block;
    margin-right: 4px;
    margin-bottom: 4px;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}


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

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Two fields side-by-side */
.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1 1 0;
    min-width: 0;
}

/* Limit form width on wide screens */
.form-wrapper {
    max-width: 900px;
}

.form-wrapper .card {
    margin-right: auto;
}

/* Address-line inputs (customer form legacy) */
.address-line {
    display: block;
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}


/* ==========================================================================
   DASHBOARD – KPI TILES
   ========================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.kpi-tile {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease;
}

.kpi-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kpi-label {
    font-size: 12px;
    color: #666;
}

.kpi-value {
    font-size: 22px;
    font-weight: bold;
    margin-top: 4px;
}


/* ==========================================================================
   DASHBOARD – QUICK ACTIONS
   ========================================================================== */

.quick-actions-title {
    font-size: 13px;
    color: #444;
    font-weight: bold;
    margin-bottom: 6px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-action-btn {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #222;
    background: #f9f9f9;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.quick-action-btn:hover {
    background: #eef3ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* ==========================================================================
   DASHBOARD – RECENT ACTIVITY PANELS
   ========================================================================== */

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.recent-panel {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.recent-panel-title {
    font-size: 13px;
    color: #444;
    font-weight: bold;
    margin-bottom: 6px;
}

.recent-panel .empty-msg {
    font-size: 12px;
    color: #777;
}

.recent-panel ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #333;
}

.recent-panel ul li {
    margin-bottom: 4px;
}

.recent-panel ul li .date {
    color: #777;
}


/* ==========================================================================
   DASHBOARD – OVERVIEW HEADER ROW
   ========================================================================== */

.overview-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.overview-header h2 {
    margin: 0;
    font-size: 18px;
}

.overview-meta {
    font-size: 12px;
    color: #666;
}


/* ==========================================================================
   ENV BADGE (bottom-left floating indicator)
   ========================================================================== */

.env-badge {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 9999;
    padding: 6px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    opacity: 0.85;
    pointer-events: none;   /* don't block clicks on content beneath */
}

.env-local { background: #28a745; }              /* green */
.env-uat   { background: #ffc107; color: #000; } /* amber */
.env-prod  { background: #dc3545; }              /* red   */


/* ==========================================================================
   RESPONSIVE – MOBILE (≤ 767px)
   ========================================================================== */

@media (max-width: 767.98px) {

    /* Top header stacks vertically */
    .top-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .title-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .user-info {
        margin-top: 6px;
        font-size: 12px;
    }

    /* Show hamburger on mobile */
    .menu-toggle {
        display: inline-block;
    }

    /* Layout goes vertical */
    .layout {
        flex-direction: column;
        min-height: auto;
    }

    /* Sidebar hidden by default; shown when .sidebar-open is toggled */
    .sidebar {
        display: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .sidebar.sidebar-open {
        display: block;
    }

    /* Tables scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Forms go full width */
    .form-wrapper,
    .card-narrow {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Tablet (768–991px): form containers go full width */
@media (max-width: 991.98px) {
    .form-wrapper,
    .card-narrow {
        max-width: 100%;
    }
}


/* ==========================================================================
   LOGIN PAGE                                                          #MZO
   Split-panel layout — indigo brand left, white form right.
   Standalone — does not use header/sidebar.
   Logo: EMS hex mark (white tile) centred above GARAGE orange pill.
   ========================================================================== */

/* ── Page shell ── */
.login-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a237e;
    padding: 24px 16px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

/* ── Outer card ── */
.login-split {
    display: flex;
    width: 100%;
    max-width: 860px;
    min-height: 520px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}


/* ══════════════════════════════════════════
   LEFT PANEL — brand / features
   ══════════════════════════════════════════ */
.login-panel-left {
    flex: 0 0 300px;
    background: #283593;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 36px;
    position: relative;
    overflow: hidden;
    gap: 36px;
}

/* Decorative circles */
.login-panel-left::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -70px;
    right: -60px;
    pointer-events: none;
}

.login-panel-left::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    bottom: -30px;
    left: -20px;
    pointer-events: none;
}

/* ── Brand block: logo tile + pill, centred ── */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* White rounded tile holding the EMS logo */
.login-logo-tile {
    width: 76px;
    height: 76px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.login-logo-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* GARAGE pill — orange text, white border */
.login-garage-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.70);
    border-radius: 20px;
    padding: 5px 18px;
}

.login-garage-pill span {
    font-size: 11px;
    font-weight: 700;
    color: #FF9800;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* ── Feature list ── */
.login-features {
    display: flex;
    flex-direction: column;
    gap: 13px;
    position: relative;
    z-index: 1;
}

.login-feat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-feat-dot {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 14px;
}

.login-feat-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.3;
}


/* ══════════════════════════════════════════
   RIGHT PANEL — login form
   ══════════════════════════════════════════ */
.login-panel-right {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 48px;
}

/* Header */
.login-form-header {
    margin-bottom: 26px;
}

.login-form-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 5px 0;
}

.login-form-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Error alert */
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}

.login-error i {
    font-size: 16px;
    flex-shrink: 0;
}

/* Field wrapper */
.login-field-wrap {
    margin-bottom: 16px;
}

.login-field-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Clean input — no icon inside, no Chrome conflict */
.login-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: Arial, sans-serif;
    display: block;
}

.login-input:focus {
    outline: none;
    border-color: #283593;
    box-shadow: 0 0 0 3px rgba(40, 53, 147, 0.10);
}

.login-input::placeholder {
    color: #c4c9d4;
}

/* Submit button */
.btn-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    margin-top: 8px;
    background: #283593;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
    letter-spacing: 0.3px;
    font-family: Arial, sans-serif;
}

.btn-login-submit:hover {
    background: #1a237e;
    transform: translateY(-1px);
}

.btn-login-submit:active {
    transform: translateY(0);
}

.btn-login-submit i {
    font-size: 17px;
}

/* Footer */
.login-footer {
    margin-top: 26px;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.6;
}


/* ══════════════════════════════════════════
   TABLET  768px – 960px
   ══════════════════════════════════════════ */
@media (max-width: 960px) {
    .login-panel-left {
        flex: 0 0 260px;
        padding: 40px 26px;
    }

    .login-panel-right {
        padding: 40px 34px;
    }

    .login-features {
        display: none;
    }
}

/* ══════════════════════════════════════════
   MOBILE  ≤ 767px
   ══════════════════════════════════════════ */
@media (max-width: 767px) {
    .login-body {
        align-items: flex-start;
        background: #283593;
        padding: 0;
    }

    .login-split {
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel-left {
        flex: 0 0 auto;
        align-items: center;
        text-align: center;
        padding: 40px 24px 28px;
        gap: 0;
    }

    .login-brand {
        margin-bottom: 0;
    }

    .login-features {
        display: none;
    }

    .login-panel-right {
        flex: 1;
        padding: 32px 24px 36px;
        border-radius: 20px 20px 0 0;
        margin-top: -16px;
        position: relative;
        z-index: 1;
        justify-content: flex-start;
    }

    /* Prevent iOS auto-zoom on input focus */
    .login-input-wrap input {
        height: 48px;
        font-size: 16px;
    }

    .btn-login-submit {
        height: 50px;
        font-size: 15px;
    }
}


/* ==========================================================================
   REUSABLE UTILITY CLASSES
   ========================================================================== */

/* 2-column form grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-top: 12px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Related content layout (e.g., form + sidebar) */
.related-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.related-wrapper.single-column {
    grid-template-columns: 1fr;
}

.related-left {
    grid-column: 1;
}

.related-right {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.related-card {
    padding: 12px;
}

/* Audit trail entries */
.audit-log-entry {
    border-bottom: 1px solid #eee;
    padding: 6px 0;
    font-size: 13px;
}

.audit-log-entry summary {
    cursor: pointer;
    color: #0066cc;
}

.audit-log-entry pre {
    background: #f7f7f7;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
}

/* Global badge (for customers, vehicles, suppliers with GLOBAL status) */
.global-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border: 1px solid #2e7d32;
    border-radius: 10px;
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
}

/* Notice box (yellow warning/info) */
.notice {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #f0c36d;
    background: #fff7e6;
    border-radius: 4px;
    font-size: 13px;
}

/* Hint text (small gray helper text under form fields) */
.hint {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .related-wrapper {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   TWO-FACTOR AUTHENTICATION                              #MZO  Session 2
   Styles for 2FA setup, verify, and reset confirmation screens
   ========================================================================== */

/* ---- 2FA login box (setup + verify screens) ---- */
.login-box-2fa {
    max-width: 480px;
    padding: 30px 35px;
}

.login-2fa-intro {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ---- Enrollment screen: ordered step list ---- */
.login-2fa-steps {
    padding-left: 20px;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.login-2fa-steps li {
    margin-bottom: 14px;
}

.login-2fa-steps b {
    color: #283593; /* GEMS indigo */
}

/* ---- QR code container ---- */
.login-2fa-qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
    padding: 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-2fa-qrcode canvas,
.login-2fa-qrcode img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---- Manual entry block (fallback when QR can't be scanned) ---- */
.login-2fa-manual {
    font-size: 13px;
    color: #555;
    background: #f5f5f5;
    border: 1px dashed #bbb;
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 6px;
    word-break: break-all;
    line-height: 1.5;
}

.login-2fa-manual code {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #283593;
    letter-spacing: 1px;
}

/* ---- Verify form ---- */
.login-2fa-form {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
}

.login-2fa-form label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

/* 6-digit code input — large, centred, monospace */
.login-2fa-code-input {
    font-size: 28px;
    letter-spacing: 12px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.login-2fa-code-input:focus {
    outline: none;
    border-color: #283593;
    box-shadow: 0 0 0 3px rgba(40, 53, 147, 0.15);
}

/* ---- Cancel / log out link under verify form ---- */
.login-2fa-cancel {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
}

.login-2fa-cancel a {
    color: #777;
    text-decoration: none;
}

.login-2fa-cancel a:hover {
    color: #c62828;
    text-decoration: underline;
}

/* ---- Confirmation page: details table (used by user_2fa_reset_confirm.php) ---- */
.confirm-details {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.confirm-details th,
.confirm-details td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}

.confirm-details th {
    background: #f7f7f7;
    width: 180px;
    font-weight: 600;
    color: #333;
}

/* #MZO — Scanner-ready field indicator */
.scanner-input {
    background-color: #e8f5e9 !important;
    border-color: #a5d6a7 !important;
}

/* ==========================================================================
   LOGIN PAGE — Chrome autofill override                               #MZO
   Prevents Chrome yellow autofill background from overriding input styles.
   ========================================================================== */

.login-input-wrap input:-webkit-autofill,
.login-input-wrap input:-webkit-autofill:hover,
.login-input-wrap input:-webkit-autofill:focus,
.login-input-wrap input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 42px #fafafa inset !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827;
    border: 1.5px solid #e5e7eb !important;
    transition: background-color 9999s ease-in-out 0s; /* delay autofill bg indefinitely */
}

.login-input-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 42px #ffffff inset, 0 0 0 3px rgba(40, 53, 147, 0.10) !important;
    border-color: #283593 !important;
}

/* ==========================================================================
   LOGIN — Suppress Chrome autofill & credential manager icons          #MZO
   The key icon and autofill dropdown button Chrome injects into password
   fields push typed text. These rules hide them.
   ========================================================================== */

/* Hide Chrome's autofill dropdown icon inside inputs */
.login-input-wrap input::-webkit-contacts-auto-fill-button,
.login-input-wrap input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Hide the key/lock icon Chrome injects into password fields */
.login-input-wrap input[type="password"]::-webkit-textfield-decoration-container {
    display: none !important;
}

/* Prevent Edge/IE from showing the reveal password eye icon */
.login-input-wrap input[type="password"]::-ms-reveal,
.login-input-wrap input[type="password"]::-ms-clear {
    display: none;
}


/* ==========================================================================
   2FA VERIFY PAGE — card layout                                        #MZO
   Centred white card on the indigo login-body background.
   Matches the login page visual language.
   ========================================================================== */

/* Outer wrapper — logo sits above card on dark body, pill renders correctly #MZO */
.twofa-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 420px;
}

.twofa-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    padding: 44px 48px 36px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Logo + pill — reuse login brand styles; margin-bottom removed, twofa-wrap gap handles spacing #MZO */
.twofa-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Shield icon + heading */
.twofa-header {
    text-align: center;
    margin-bottom: 24px;
}

.twofa-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #283593;
    font-size: 26px;
}

.twofa-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 6px 0;
}

.twofa-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Field */
.twofa-field {
    width: 100%;
    margin-bottom: 16px;
}

.twofa-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* 6-digit code input */
.twofa-code-input {
    width: 100%;
    height: 56px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 28px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 10px;
    text-align: center;
    color: #1a237e;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.twofa-code-input:focus {
    outline: none;
    border-color: #283593;
    box-shadow: 0 0 0 3px rgba(40, 53, 147, 0.10);
    background: #ffffff;
}

.twofa-code-input::placeholder {
    color: #d1d5db;
    letter-spacing: 8px;
}

/* Verify button — full width, reuses btn-login-submit */
.twofa-card .btn-login-submit {
    width: 100%;
    margin-top: 0;
    margin-bottom: 16px;
}

/* Cancel link */
.twofa-cancel {
    text-align: center;
    font-size: 13px;
    margin-bottom: 20px;
}

.twofa-cancel a {
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.twofa-cancel a:hover {
    color: #c62828;
}

/* Mobile */
@media (max-width: 480px) {
    .twofa-card {
        border-radius: 0;
        min-height: 100vh;
        justify-content: center;
        padding: 40px 24px;
    }
}
