/**
 * bootstrap-match.css
 * Vanilla CSS that replicates the visual appearance of Bootstrap 3.3.6
 * as used by the CRC eCS WebUI. No Bootstrap JS or jQuery required.
 *
 * Usage: <link rel="stylesheet" href="/assets/css/bootstrap-match.css">
 * Pair with vanilla JS for dropdown toggles.
 */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.42857;
  color: #333; background: #fff;
}
a { color: #337ab7; text-decoration: none; }
a:hover { color: #23527c; text-decoration: underline; }
hr { border: 0; border-top: 1px solid #e7e7e7; margin: 20px 0; }
label { font-weight: 700; }
h1, h2, h3, h4, h5, h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; }
h1 { font-size: 36px; } h2 { font-size: 30px; } h3 { font-size: 24px; } h4 { font-size: 18px; }
small, .small { font-size: 85%; color: #777; }
.help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; font-size: 85%; }
.text-danger { color: #a94442; }
.text-info { color: #31708f; }
.text-success { color: #3c763d; }
.text-warning { color: #8a6d3b; }
.text-muted { color: #777; }

/* ===== Container ===== */
.container { max-width: 1170px; margin: 0 auto; padding: 0 15px; }
.container-fluid { padding: 0 15px; }

/* ===== Navbar ===== */
.navbar { min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.navbar::after { content: ''; display: table; clear: both; }
.navbar-default {
  background: #f8f8f8; border-color: #e7e7e7;
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}
.navbar-header { float: left; }
.navbar-brand {
  float: left; padding: 15px; font-size: 18px; line-height: 20px;
  color: #777; height: 50px;
}
.navbar-brand:hover { color: #5e5e5e; text-decoration: none; }
.navbar-collapse { float: left; }
.navbar-nav { list-style: none; margin: 0; padding: 0; float: left; }
.navbar-nav > li { float: left; position: relative; }
.navbar-nav > li > a { display: block; padding: 15px; color: #555; line-height: 20px; }
.navbar-nav > li > a:hover { color: #333; background: #e7e7e7; text-decoration: none; }
.navbar-nav > li.active > a { color: #555; background: #e7e7e7; }
.navbar-right { float: right; }
.caret {
  display: inline-block; width: 0; height: 0; vertical-align: middle;
  border-top: 4px dashed; border-right: 4px solid transparent; border-left: 4px solid transparent;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Dropdown ===== */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 1000;
  min-width: 160px; padding: 5px 0; margin: 2px 0 0;
  list-style: none; font-size: 14px;
  background: #fff; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.176);
}
.dropdown-menu > li > a { display: block; padding: 3px 20px; color: #333; white-space: nowrap; }
.dropdown-menu > li > a:hover { background: #f5f5f5; color: #262626; text-decoration: none; }
.dropdown-menu > .divider { height: 1px; margin: 9px 0; overflow: hidden; background: #e5e5e5; }
.dropdown.open > .dropdown-menu { display: block; }

/* ===== Panels ===== */
.panel { margin-bottom: 20px; background: #fff; border: 1px solid transparent; border-radius: 4px; box-shadow: 0 1px 1px rgba(0,0,0,0.05); }
.panel-default { border-color: #ddd; }
.panel-success { border-color: #d6e9c6; }
.panel-warning { border-color: #faebcc; }
.panel-danger { border-color: #ebccd1; }
.panel-info { border-color: #bce8f1; }
.panel-heading {
  padding: 10px 15px; border-bottom: 1px solid transparent; border-radius: 3px 3px 0 0;
}
.panel-default > .panel-heading { background: #f5f5f5; border-color: #ddd; color: #333; }
.panel-success > .panel-heading { background: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.panel-warning > .panel-heading { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }
.panel-danger > .panel-heading { background: #f2dede; border-color: #ebccd1; color: #a94442; }
.panel-info > .panel-heading { background: #d9edf7; border-color: #bce8f1; color: #31708f; }
.panel-body { padding: 15px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 6px 12px; font-size: 14px; font-weight: 400;
  line-height: 1.42857; text-align: center; white-space: nowrap; vertical-align: middle;
  cursor: pointer; border: 1px solid transparent; border-radius: 4px;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn-default { color: #333; background: #fff; border-color: #ccc; }
.btn-default:hover { background: #e6e6e6; border-color: #adadad; }
.btn-info { color: #fff; background: #5bc0de; border-color: #46b8da; }
.btn-info:hover { background: #31b0d5; border-color: #269abc; }
.btn-success { color: #fff; background: #5cb85c; border-color: #4cae4c; }
.btn-success:hover { background: #449d44; border-color: #398439; }
.btn-primary { color: #fff; background: #337ab7; border-color: #2e6da4; }
.btn-primary:hover { background: #286090; border-color: #204d74; }
.btn-warning { color: #fff; background: #f0ad4e; border-color: #eea236; }
.btn-warning:hover { background: #ec971f; border-color: #d58512; }
.btn-danger { color: #fff; background: #d9534f; border-color: #d43f3a; }
.btn-danger:hover { background: #c9302c; border-color: #ac2925; }
.btn-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; }
.btn-xs { padding: 1px 5px; font-size: 12px; border-radius: 3px; }

/* ===== Tables ===== */
.table { width: 100%; max-width: 100%; margin-bottom: 20px; border-collapse: collapse; }
.table > thead > tr > th,
.table > tbody > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td { padding: 8px; line-height: 1.42857; vertical-align: top; border-top: 1px solid #ddd; }
.table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #ddd; font-weight: 700; }
.table-bordered { border: 1px solid #ddd; }
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td { border: 1px solid #ddd; }
.table-striped > tbody > tr:nth-child(odd) { background: #f9f9f9; }

/* ===== Alerts ===== */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { background: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.alert-info { background: #d9edf7; border-color: #bce8f1; color: #31708f; }
.alert-warning { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }
.alert-danger { background: #f2dede; border-color: #ebccd1; color: #a94442; }

/* ===== Flash messages (scan station) ===== */
.flash { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.flash.ok { background: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.flash.danger { background: #f2dede; border-color: #ebccd1; color: #a94442; }
.flash.warn { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }

/* ===== Forms ===== */
.form-control {
  display: block; width: 100%; height: 34px; padding: 6px 12px;
  font-size: 14px; line-height: 1.42857; color: #555;
  background: #fff; border: 1px solid #ccc; border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
}
select.form-control { height: 34px; }
textarea.form-control { height: auto; }

/* ===== Scan station specific ===== */
.scan-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.scan-setting { display: flex; align-items: center; gap: 6px; margin: 12px 0; font-size: 13px; color: #777; }
textarea.scan-textarea {
  width: 100%; padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px; resize: vertical; background: #fffff0;
}
input.scan-input {
  flex: 1; padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}
.result-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-created { color: #3c763d; font-weight: 600; }
.status-existing { color: #8a6d3b; font-weight: 600; }

/* ===== Forms: inline & groups ===== */
.form-group { margin-bottom: 15px; }
.form-inline .form-group { display: inline-block; vertical-align: middle; margin-bottom: 0; margin-right: 10px; }
.form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; }
.form-inline .control-label,
.form-inline label { margin-bottom: 0; vertical-align: middle; margin-right: 5px; }
.form-inline .btn { vertical-align: middle; }

/* ===== List Groups ===== */
.list-group { padding-left: 0; margin-bottom: 20px; list-style: none; }
.list-group-item {
  position: relative; display: block; padding: 10px 15px;
  margin-bottom: -1px; background: #fff; border: 1px solid #ddd;
}
.list-group-item:first-child { border-radius: 4px 4px 0 0; }
.list-group-item:last-child { margin-bottom: 0; border-radius: 0 0 4px 4px; }

/* ===== Close button ===== */
.close {
  float: right; font-size: 21px; font-weight: 700; line-height: 1;
  color: #000; text-shadow: 0 1px 0 #fff; opacity: 0.2;
  background: none; border: none; cursor: pointer; padding: 0;
}
.close:hover { opacity: 0.5; }

/* ===== Modal content (used inside <dialog>) ===== */
.modal-content { background: #fff; }
.modal-header { padding: 15px; border-bottom: 1px solid #e5e5e5; }
.modal-header::after { content: ''; display: table; clear: both; }
.modal-body { padding: 15px; }
.modal-footer { padding: 15px; border-top: 1px solid #e5e5e5; text-align: right; }
.modal-footer .btn + .btn { margin-left: 5px; }
.modal-title { margin: 0; line-height: 1.42857; font-size: 18px; }

/* ===== Spacing utilities ===== */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }
.mr-3 { margin-right: 16px; }

/* ===== Grid (minimal Bootstrap 3 grid for auth forms) ===== */
.row { margin-left: -15px; margin-right: -15px; }
.row::after { content: ''; display: table; clear: both; }
.col-md-6 { width: 50%; float: left; padding: 0 15px; }
.col-md-8 { width: 66.667%; float: left; padding: 0 15px; }
.col-md-4 { width: 33.333%; float: left; padding: 0 15px; }
.col-md-offset-2 { margin-left: 16.667%; }
.col-md-offset-4 { margin-left: 33.333%; }

/* ===== Forms: horizontal & validation ===== */
.form-horizontal .form-group { margin-left: -15px; margin-right: -15px; }
.form-horizontal .form-group::after { content: ''; display: table; clear: both; }
.form-horizontal .control-label { text-align: right; padding-top: 7px; }
.has-error .form-control { border-color: #a94442; }
.has-error .help-block, .has-error .control-label { color: #a94442; }
.checkbox { margin-top: 0; margin-bottom: 10px; }
.checkbox label { font-weight: 400; }

/* ===== Fieldset & Legend (Bootstrap 3 style) ===== */
fieldset {
  min-width: 0; padding: 0; margin: 0; border: 0;
  border-top: 1px solid #e5e5e5; margin-top: 20px; padding-top: 10px;
}
legend {
  display: block; width: auto; padding: 0 5px; margin-bottom: 0;
  font-size: 21px; line-height: inherit; color: #333;
  border: 0; border-bottom: none;
}

/* ===== Utilities ===== */
.clearfix::after { content: ''; display: table; clear: both; }
.pull-left { float: left; }
.pull-right { float: right; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
