/*
 * Bootstrap 4.6 with the Bootstrap 3 look (ZCC-736).
 *
 * Core 2.1 ships Bootstrap 4.6.2 instead of 3.4.1 (every 3.x release carries open XSS advisories).
 * Load this file right after bootstrap.min.css. It does not re-implement Bootstrap 3: the templates
 * use Bootstrap 4 classes. It only restates the Bootstrap 3 (+ bootstrap-theme) values that make
 * the server-rendered pages and the React Console inside them look as they did:
 *
 *  - the root font size. Bootstrap 3 set `html { font-size: 10px }` and sized components in px;
 *    Bootstrap 4 sizes them in rem against the browser's 16px. 14px — Bootstrap 3's body size —
 *    makes Bootstrap 4's rem-based buttons, inputs and headings come out at their Bootstrap 3 size.
 *    The Console's MUI theme reads the same value (design-system `bootstrapHtmlFontSize`), so the
 *    two must change together.
 *  - Bootstrap 3's colours (#337ab7 primary, #333 text) and bootstrap-theme's button gradients,
 *    which Bootstrap 4 dropped (it has no bootstrap-theme.css).
 *  - `.btn-xs`, which Bootstrap 4 removed.
 */

html {
    font-size: 14px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
}

a {
    color: #337ab7;
}
a:hover,
a:focus {
    color: #23527c;
}

label {
    font-weight: 700;
    margin-bottom: 5px;
}

input[type="radio"],
input[type="checkbox"] {
    margin: 4px 0 0;
    line-height: normal;
}

/* Bootstrap 3's normalize gave form controls `font: inherit`; Bootstrap 4's reboot omits the weight. */
input, button, select, optgroup, textarea {
    font-weight: inherit;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    margin-bottom: 10px;
}
h1, h2, h3, .h1, .h2, .h3 {
    margin-top: 20px;
}
h4, h5, h6, .h4, .h5, .h6 {
    margin-top: 10px;
}
h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 30px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 12px; }

p {
    margin: 0 0 10px;
}

ul, ol {
    margin-bottom: 10px;
}
dl {
    margin-bottom: 20px;
}
dd {
    margin-bottom: 0;
}

code {
    padding: 2px 4px;
    font-size: 90%;
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 4px;
}

hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border-top: 1px solid #eee;
}

legend {
    margin-bottom: 20px;
    font-size: 21px;
    line-height: inherit;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
}

.text-muted {
    color: #777 !important;
}

/* ── Breadcrumb: the layout renders plain text in it, not .breadcrumb-item children ───────── */
.breadcrumb {
    display: block;
    padding: 8px 15px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────────────────────── */
.btn {
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    border-radius: 4px;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}
.btn-lg {
    padding: 10px 16px;
    font-size: 18px;
    line-height: 1.3333333;
    border-radius: 6px;
}
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* bootstrap-theme .btn-primary */
.btn-primary {
    color: #fff;
    background-color: #265a88;
    background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%);
    background-repeat: repeat-x;
    border-color: #245580;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
    color: #fff;
    background-color: #265a88;
    background-position: 0 -15px;
    border-color: #204d74;
}
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: #265a88;
    background-image: none;
    border-color: #245580;
}
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active:focus {
    box-shadow: 0 0 0 0.2rem rgba(51, 122, 183, 0.5);
}

/* bootstrap-theme .btn-default — Bootstrap 4's closest class is .btn-light */
.btn-light {
    color: #333;
    background-color: #e0e0e0;
    background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
    background-repeat: repeat-x;
    border-color: #ccc;
    text-shadow: 0 1px 0 #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
}
.btn-light:hover,
.btn-light:focus,
.btn-light.focus {
    color: #333;
    background-color: #e0e0e0;
    background-position: 0 -15px;
    border-color: #adadad;
}
.btn-light:not(:disabled):not(.disabled):active,
.btn-light:not(:disabled):not(.disabled).active,
.show > .btn-light.dropdown-toggle {
    color: #333;
    background-color: #e0e0e0;
    background-image: none;
    border-color: #dbdbdb;
}
.btn-light:focus,
.btn-light.focus,
.btn-light:not(:disabled):not(.disabled):active:focus {
    box-shadow: 0 0 0 0.2rem rgba(204, 204, 204, 0.5);
}

/* bootstrap-theme .btn-success */
.btn-success {
    background-color: #419641;
    background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%);
    background-repeat: repeat-x;
    border-color: #3e8f3e;
}
.btn-success:hover,
.btn-success:focus {
    background-color: #419641;
    background-position: 0 -15px;
}

/* ── Forms ────────────────────────────────────────────────────────────────────────────────── */
.form-control {
    height: 34px;
    font-weight: inherit;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    border-color: #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-control:focus {
    color: #555;
    border-color: #66afe9;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
select[multiple].form-control,
textarea.form-control {
    height: auto;
}
.form-control-sm {
    height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}
.form-group {
    margin-bottom: 15px;
}
.form-text {
    margin-top: 5px;
    margin-bottom: 10px;
    color: #737373;
}

/* ── Tables ───────────────────────────────────────────────────────────────────────────────── */
.table {
    margin-bottom: 20px;
}
.table th,
.table td {
    padding: 8px;
    line-height: 1.42857143;
    border-top-color: #ddd;
}
.table thead th {
    border-bottom: 2px solid #ddd;
}
.table-sm th,
.table-sm td {
    padding: 5px;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}
.table-hover tbody tr:hover {
    background-color: #f5f5f5;
}
.table-bordered,
.table-bordered th,
.table-bordered td {
    border-color: #ddd;
}

/* ── Dropdowns (outside the navbar, e.g. bootstrap-select) ────────────────────────────────── */
.dropdown-menu {
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    font-size: 14px;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}
.dropdown-item {
    padding: 3px 20px;
    line-height: 1.42857143;
    color: #333;
}
.dropdown-item:hover,
.dropdown-item:focus {
    color: #262626;
    background-color: #e8e8e8;
    background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
    background-repeat: repeat-x;
}
.dropdown-item.active,
.dropdown-item:active {
    color: #fff;
    background-color: #2e6da4;
    background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
    background-repeat: repeat-x;
}

/* ── Alerts: Bootstrap 3 palette ──────────────────────────────────────────────────────────── */
.alert {
    border-radius: 4px;
}
.alert-success { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; }
.alert-info    { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; }
.alert-warning { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; }
.alert-danger  { color: #a94442; background-color: #f2dede; border-color: #ebccd1; }
