/* Vars */
:root {
  --main-bg-color: #274590;
  --primary-font-size: 16px;
  --brand-red: #a31d22;
  --brand-blue: #00447c;
  --text-dark: #333;
  --border-gray: #ccc;
  --link-blue: #007bff;
}

/* General */
html {
    margin: 0;
    padding: 0;
}
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100vw;
    overflow:scroll;
    min-height: 100vh;
    background: #444;
    color: white;
    font-family: "Helvetica Neue", Helvetica, Arial , sans-serif;
    font-size: var(--primary-font-size);
    line-height: 20px;
    transition: background .25s ease;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
}
body.light {
    background: #eee;
    color: #444;
}
body > div {
    max-width: 100vw;
    overflow:hidden;
}

h1 {
    font-size: 24px;
}
pre {
    box-sizing:border-box;
    display:inline-block;
    max-height:300px;
    width:auto;
    max-width:100%;
    overflow:scroll;
    padding:20px;
    border-radius:12px;
    background:black;
    color:white;
    margin-right: 10px;
    margin-bottom: 10px;
}
* {
    box-sizing: border-box;
}

/* Page and Header */
.page_wrapper {
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px 24px;
}
.page_wrapper.full {
    max-width: calc(100% - 80px);
    margin: 0 40px;
}
.page_topbar {
    background: var(--main-bg-color);
    color: white;
    padding: 2px;
}
.page_topbar header.page_wrapper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    align-content: center;
}
.page_topbar header.page_wrapper a {
    color: white;
    text-decoration: none;
}
.page_topbar header.page_wrapper a img.page_logo {
    max-width: 220px;
}

/* DataTables */
.page_wrapper .dt-container {
    margin-top: 40px;
    margin-bottom: 20px;
    max-width: calc(100vw - 80px);
    overflow: scroll;
}
table.dataTable>tbody>tr:not([data-dt-row]):nth-child(even) {
    background: rgba(212,212,212,0.15);
}
body.light table.dataTable>tbody>tr:not([data-dt-row]):nth-child(even) {
    background: rgba(212,212,212,0.6);
}
.table_top {
    display: grid;
    grid-template-columns: 1fr auto auto;
    justify-content: space-between;
    column-gap: 20px;
    padding-bottom: 10px;
}
.table_top .dt-length {

}
.table_top .dt-search {
    
}
.table_top .dt-buttons {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 20px;
}
.table_bottom {
    display: grid;
    grid-template-columns: auto 1fr;
    justify-content: space-between;
    column-gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
}
.table_bottom .dt-info {

}
.table_bottom .dt-paging {
    justify-self: flex-end;
}

/* DataTables Buttons Overrides */
/* Select (as a Button) */
.dt-button {
    padding: 5px 13px 4px 13px;
    border: 1px solid rgba(212,212,212,1);
    
}
.dt-button label {
    color: white;
    font-size: 16px;
}
body.light .dt-button label {
    color: rgb(68,68,68);
}
.dt-button.filter_select {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    appearance: unset;
}
.dt-button.filter_select span {
    display: inline-block;
}
.dt-button.filter_select span select {
    padding: 5px 13px 4px 13px;
    border: 1px solid rgba(212,212,212,1);
    background: #F6F6F6;
}

/* DataTables Additional Row Overrides */
table.dataTable>tbody>tr>td {
    transition: all .25s ease;
    border-top: 1px solid transparent;
}
table.dataTable>tbody>tr.dt-hasChild>td {
    border-top: 5px solid #444;
}
body.light table.dataTable>tbody>tr.dt-hasChild>td {
    border-top: 5px solid #EDEEED;
}
/* table.dataTable>tbody>tr.dt-hasChild {
    position: relative;
}
table.dataTable>tbody>tr.dt-hasChild::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: red;
} */
table.dataTable>tbody>tr.dt-hasChild,
table.dataTable>tbody>tr[data-dt-row] {
    background-color: rgba(44,170,226,.3) !important;
}
.detail_grid {
    padding: 0px 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-column-gap: 40px;
}
.detail_grid .detail_origin p,
.detail_grid .detail_destination p {
    display: inline-grid;
    width: 100%;
    grid-template-columns: 1fr;
}
.detail_grid .detail_origin label,
.detail_grid .detail_destination label {
    display: inline-block;
    width: 100%;
}
.detail_grid .detail_your_notes {
    grid-column: 1 / span 2;
}
.detail_grid .detail_your_notes strong {
    display: inline-block;
    width: 100%;
}
.detail_grid .detail_your_notes textarea {
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    min-height: 100px;
}
.detail_grid .unit_buttons {
    display: inline-block;
    width: 100%;
}
.detail_grid .unit_buttons button {
    padding: 7px 13px 5px 13px;
    font-size: 16px;
    background: var(--main-bg-color);
    border: 1px solid var(--main-bg-color);
    border-radius: 5px;
    color: white;
    display: inline-block;
    margin-top: 5px;
    margin-right: 5px;
}
.unit_contact_link {
    color: #2CAAE2;
    text-decoration: underline;
    cursor: pointer;
}

/* Theme Toggle */
.theme_wrap {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: 1fr;
    align-items: center;
    column-gap: 6px;
}
.toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.toggle input {
  display: none;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #FFF;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--main-bg-color);
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Footer */
.page_bottombar {
    background: var(--main-bg-color);
    color: white;
}
footer.page_wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    
}
.subfooter {
    background: #499DD9;
}
.subfooter .page_wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.subfooter .page_wrapper .footer_dh {

}
.subfooter .page_wrapper .footer_copyright {
    
}
.subfooter .page_wrapper .theme_wrap {
    justify-self: flex-end;
    justify-content: flex-end;
    text-align: right;
}
.footer_legend {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 10px;
}
.footer_legend h4 {
    grid-column: 1 / span 2;
    grid-row: 1 / span 1;
}
.footer_legend > span:nth-child(even) {
    font-weight: bold;
}
.footer_legend > span:last-child {
    grid-column: 1 / span 2;
    padding-top: 10px;
}

/* jQuery UI Dialog Overrides */
#status_dialog {
    display: none;
}
#status_dialog form {
    display: grid;
    grid-template-columns: 1fr;
    color: #444;
    overflow:hidden;
}
#status_dialog form label {
    display: inline-block;
    width: 100%;
    position: relative;
}
#status_dialog form label span {
    display: inline-block;
    width: 100%;
}
#status_dialog form label input[readonly]  {

}
#status_dialog form label input[type="text"] {
    display: inline-block;
    width: 100%;
    padding: 6px 14px;
    font-size: 16px;
    background: #E9ECEF;
    border: 1px solid #E9ECEF;
    border-radius: 5px;
    pointer-events: none;
    margin-bottom: 10px;
}
#status_dialog form label input[type="text"],
#status_dialog form label input[type="text"]:focus {
    outline:none !important;
}
#status_dialog form label textarea {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    min-height: 100px;
    margin-top: 10px;
    padding: 10px;
}
#status_dialog form label button {
    display: inline-block;
    padding: 10px 13px 9px 13px !important;
    font-size: 16px;
    background: var(--main-bg-color);
    border: 1px solid var(--main-bg-color);
    border-radius: 5px;
    color: white;
    display: inline-block;
    margin-top: 5px;
    margin-right: 5px;
}
.ui-dialog:has(>#status_dialog) {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
}
.ui-widget-overlay {
    background: rgba(0,0,0,0.9);
}

/* Login */
.login-container {
    max-width: 450px;
    margin: 40px auto;
}
 .form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.btn-submit {
    background-color: var(--brand-red);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #8a181c;
}

.footer-links {
    margin-top: 25px;
    font-size: 1rem;
}

.footer-links a {
    color: var(--link-blue);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 0.95rem;
    color: #333;
    margin-top: 40px;
}

.error-msg {
    color: var(--brand-red);
    margin-bottom: 15px;
    font-weight: bold;
}

/* Modal Field Styling */
.field-group {
    margin-bottom: 15px;
}

.field-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-family: sans-serif;
    color: #333;
}

.field-group input, 
.field-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

/* Red Button Styling */
.submit-btn {
    background-color: #a31d21;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.submit-btn:hover {
    background-color: #82171a;
}

/* Modal specific tweaks */
.ui-dialog {
    display: none;
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.ui-dialog-titlebar-close {
    backdrop-filter: invert(1);
}


/* jQuery UI Dialog Overrides */
#status_dialog,
#loginModal {
    display: none;
}
#status_dialog form,
#loginModal form {
    display: grid;
    grid-template-columns: 1fr;
    color: #444;
    overflow:hidden;
}
#status_dialog form label,
#loginModal form label {
    display: inline-block;
    width: 100%;
    position: relative;
}
#status_dialog form label span,
#loginModal form label span {
    display: inline-block;
    width: 100%;
}
#status_dialog form label input[readonly]  {

}
#status_dialog form label input[type="text"],
#loginModal form label input[type="text"] {
    display: inline-block;
    width: 100%;
    padding: 6px 14px;
    font-size: 16px;
    background: #E9ECEF;
    border: 1px solid #E9ECEF;
    border-radius: 5px;
    pointer-events: none;
    margin-bottom: 10px;
}
#status_dialog form label input[type="text"],
#status_dialog form label input[type="text"]:focus,
#loginModal form label input[type="text"],
#loginModal form label input[type="text"]:focus {
    outline:none !important;
}
#status_dialog form label textarea,
#loginModal form label textarea {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    min-height: 100px;
    margin-top: 10px;
    padding: 10px;
}
#status_dialog form label button,
#loginModal form label button {
    display: inline-block;
    padding: 10px 13px 9px 13px !important;
    font-size: 16px;
    background: var(--main-bg-color);
    border: 1px solid var(--main-bg-color);
    border-radius: 5px;
    color: white;
    display: inline-block;
    margin-top: 5px;
    margin-right: 5px;
}
.ui-dialog:has(>#status_dialog),
.ui-dialog:has(>#loginModal) {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
}
.ui-widget-overlay {
    background: rgba(0,0,0,0.9);
}