:root {
    --imh-navy: #17324d;
    --imh-navy-dark: #10263a;
    --imh-blue: #2f6ea5;
    --imh-blue-hover: #275e8e;
    --imh-bg: #f4f6f9;
    --imh-border: #dfe4ea;
    --imh-text: #243447;
    --imh-muted: #6c7885;
    --imh-card-radius: 10px;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    background-color: var(--imh-bg);
    color: var(--imh-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================================================
   Navigation
   ========================================================= */

.imh-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.imh-navbar {
    min-height: 64px;
    background: linear-gradient( 135deg, var(--imh-navy-dark), var(--imh-navy) );
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.imh-brand {
    margin-right: 2.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.imh-navbar .nav-link {
    position: relative;
    margin-right: 0.35rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .imh-navbar .nav-link:hover {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.08);
    }

    .imh-navbar .nav-link.active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.14);
    }

    .imh-navbar .nav-link.disabled {
        color: rgba(255, 255, 255, 0.34);
    }

/* =========================================================
   Page shell
   ========================================================= */

.imh-main {
    min-height: calc(100vh - 110px);
    padding: 2rem 2rem 3rem;
}

    .imh-main > .container-fluid {
        max-width: 1500px;
        margin: 0 auto;
    }

.imh-footer {
    padding: 1rem 0;
    color: var(--imh-muted);
    background-color: #fff;
    border-top: 1px solid var(--imh-border);
    font-size: 0.85rem;
}

/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1c2d3e;
    font-weight: 650;
}

.text-muted {
    color: var(--imh-muted) !important;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
    border: 1px solid var(--imh-border);
    border-radius: var(--imh-card-radius);
    overflow: hidden;
    background-color: #fff;
}

    .card.shadow-sm {
        box-shadow: 0 3px 12px rgba(25, 40, 55, 0.06) !important;
    }

.card-header {
    padding: 1rem 1.25rem;
    background-color: #fafbfc;
    border-bottom: 1px solid var(--imh-border);
    color: #243447;
}

.card-body {
    padding: 1.35rem;
}

/* =========================================================
   Forms
   ========================================================= */

.form-label {
    margin-bottom: 0.4rem;
    color: #3a4958;
    font-size: 0.88rem;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #cfd7df;
    border-radius: 7px;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--imh-blue);
        box-shadow: 0 0 0 0.2rem rgba(47, 110, 165, 0.13);
    }

    .form-control[readonly] {
        background-color: #f5f7f9;
        color: #5d6975;
    }

textarea.form-control {
    min-height: 110px;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    border-radius: 7px;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--imh-blue);
    border-color: var(--imh-blue);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--imh-blue-hover);
        border-color: var(--imh-blue-hover);
    }

.btn-outline-primary {
    color: var(--imh-blue);
    border-color: var(--imh-blue);
}

    .btn-outline-primary:hover {
        background-color: var(--imh-blue);
        border-color: var(--imh-blue);
    }

/* =========================================================
   Tables
   ========================================================= */

.table {
    margin-bottom: 0;
}

    .table thead th {
        padding: 0.85rem 1rem;
        color: #526170;
        background-color: #f7f9fb;
        border-bottom: 1px solid var(--imh-border);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.025em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 0.9rem 1rem;
        border-color: #edf0f3;
        vertical-align: middle;
    }

.table-hover tbody tr:hover {
    background-color: #f8fbfe;
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    font-weight: 600;
}

    .badge.bg-secondary {
        background-color: #e7ebef !important;
        color: #4b5865 !important;
    }

/* =========================================================
   Validation / alerts
   ========================================================= */

.text-danger {
    font-size: 0.85rem;
}

.alert {
    border-radius: 8px;
    border-width: 1px;
}

.alert-success {
    background-color: #edf8f1;
    border-color: #c8e7d2;
    color: #24643a;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {
    .imh-main {
        padding: 1.25rem 1rem 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table thead th,
    .table tbody td {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* =========================================================
   Order List
   ========================================================= */

.imh-orders-table tbody tr {
    transition: background-color 0.12s ease;
}

.imh-orders-table tbody td {
    height: 66px;
}

.imh-order-link {
    color: var(--imh-blue);
    font-weight: 650;
    text-decoration: none;
}

    .imh-order-link:hover {
        color: var(--imh-blue-hover);
        text-decoration: underline;
    }


/* =========================================================
   Status Badges
   ========================================================= */

.imh-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.imh-status-draft {
    color: #53606d;
    background-color: #e9edf1;
}

.imh-status-submitted {
    color: #205b8f;
    background-color: #e5f1fb;
}

.imh-status-processing {
    color: #856404;
    background-color: #fff3cd;
}

.imh-status-completed {
    color: #23683c;
    background-color: #e3f4e9;
}

.imh-status-cancelled {
    color: #9a3039;
    background-color: #f9e4e6;
}

.imh-status-default {
    color: #53606d;
    background-color: #e9edf1;
}


/* =========================================================
   Empty States
   ========================================================= */

.imh-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: var(--imh-blue);
    background-color: #eaf2f8;
    font-size: 1.8rem;
    font-weight: 300;
}

/* =========================================================
   Read-only Order Fields
   ========================================================= */

.imh-readonly-field {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    color: #4f5c68;
    background-color: #f5f7f9;
    border: 1px solid #d8dee5;
    border-radius: 7px;
}

.imh-monospace {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}


/* =========================================================
   Order Lines
   ========================================================= */

.imh-order-lines-table tbody td {
    min-height: 68px;
}

.imh-line-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 0.45rem;
    color: #465564;
    background-color: #eef1f4;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
}

.imh-order-total-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    background-color: #fafbfc;
    border-top: 2px solid var(--imh-border);
}

.imh-order-total {
    color: #1c2d3e;
    font-size: 1.05rem;
}

/* =========================================================
   Geography
   ========================================================= */

.imh-geography-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.imh-geography-include {
    color: #23683c;
    background-color: #e3f4e9;
}

.imh-geography-exclude {
    color: #9a3039;
    background-color: #f9e4e6;
}

.imh-geography-code {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    color: #53606d;
    background-color: #f1f3f5;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.8rem;
}

/* ============================================================
   IMH Compact Form Controls
   ============================================================ */

/*
 * Keep application forms compact and data-entry focused.
 * These rules apply to normal Bootstrap form controls
 * throughout the IMH application.
 */

.form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}


/* ------------------------------------------------------------
   Text / Number / Date Controls
   ------------------------------------------------------------ */

.form-control {
    min-height: 2.125rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}


/* ------------------------------------------------------------
   Select / Dropdown Controls
   ------------------------------------------------------------ */

.form-select {
    min-height: 2.125rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}


/* ------------------------------------------------------------
   Textareas
   ------------------------------------------------------------ */

/*
 * Do not force the same minimum height as a single-line input.
 * The rows attribute on the textarea continues to control
 * its overall height.
 */

textarea.form-control {
    min-height: auto;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}


/* ------------------------------------------------------------
   Checkboxes / Radio Buttons
   ------------------------------------------------------------ */

.form-check {
    min-height: 1.25rem;
    margin-bottom: 0.25rem;
}

.form-check-input {
    margin-top: 0.2rem;
}

.form-check-label {
    font-size: 0.875rem;
}


/* ------------------------------------------------------------
   Validation Messages
   ------------------------------------------------------------ */

.field-validation-error,
.text-danger {
    font-size: 0.8125rem;
}


/* ------------------------------------------------------------
   Input Groups
   ------------------------------------------------------------ */

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    min-height: 2.125rem;
    font-size: 0.875rem;
}

.input-group-text {
    padding: 0.25rem 0.5rem;
}


/* ------------------------------------------------------------
   Explicit Bootstrap Small Controls
   ------------------------------------------------------------ */

/*
 * Some existing screens already use form-control-sm and
 * form-select-sm. Keep those slightly smaller than our
 * standard IMH controls.
 */

.form-control-sm,
.form-select-sm {
    min-height: 1.875rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.8125rem;
}


/* ------------------------------------------------------------
   Disabled / Read-only
   ------------------------------------------------------------ */

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    opacity: 1;
}

/* ============================================================
   IMH Compact Form Layout
   ============================================================ */

.imh-form-row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0.75rem;
}

/* ============================================================
   IMH Compact Cards
   ============================================================ */

.imh-main .card-header {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.imh-main .card-body {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.imh-main .card-footer {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

/* ============================================================
   IMH Compact Buttons
   ============================================================ */

/*
 * Standard IMH buttons are slightly smaller than Bootstrap's
 * defaults to better fit a data-entry/business application.
 */

.btn {
    min-height: 2.125rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}


/* ------------------------------------------------------------
   Small Buttons
   ------------------------------------------------------------ */

/*
 * Used for row-level actions such as Edit, Remove, View ZIPs,
 * etc.
 */

.btn-sm {
    min-height: 1.875rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.35;
}


/* ------------------------------------------------------------
   Large Buttons
   ------------------------------------------------------------ */

/*
 * Preserve a larger option for the rare places where we
 * intentionally want a prominent action.
 */

.btn-lg {
    min-height: 2.625rem;
    padding: 0.4rem 1rem;
    font-size: 1rem;
}


/* ------------------------------------------------------------
   Button Groups
   ------------------------------------------------------------ */

.btn-group > .btn,
.btn-group-sm > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* ------------------------------------------------------------
   Buttons containing icons
   ------------------------------------------------------------ */

.btn svg,
.btn i {
    vertical-align: middle;
}


/* ------------------------------------------------------------
   Disabled Buttons
   ------------------------------------------------------------ */

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
}

/* ============================================================
   IMH Action Buttons
   ============================================================ */

.imh-action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    white-space: nowrap;
}

