/* Miligram overrides */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
}

.top-nav-links,
.side-nav,
h1, h2, h3, h4, h5, h6 {
    font-family: "Raleway", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    color: #363637;
}

a {
    color:#2f85ae;
    -webkit-transition:all 0.2s linear;
    transition:all 0.2s linear;
}

a:hover,
a:focus,
a:active  {
    color:#2a6496;
    -webkit-transition:all 0.2s easeout;
    transition:all 0.2s ease-out;
}

.side-nav a,
.top-nav-links a,
th a,
.actions a {
    color: #606c76;
}

.side-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.side-nav .heading {
    flex: 0 0 auto;
    margin: 0;
    padding-right: 0.75rem;
    margin-right: 0.15rem;
    border-right: 1px solid #dbe3ee;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.8;
}

.side-nav a.side-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.side-nav a.side-nav-item:hover,
.side-nav a.side-nav-item:focus {
    background: #eff6ff;
    border-color: #2f85ae;
    color: #2f85ae;
}

.side-nav a.side-nav-item-danger:hover,
.side-nav a.side-nav-item-danger:focus {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.side-nav-icon {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.side-nav-label {
    line-height: 1.2;
}

/* Utility */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Main */
body {
    background: #f5f7fa;
}
.main {
    width: 100%;
    padding-top: 0.5rem;
}
.main .container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 clamp(1rem, 2.5vw, 3rem);
}
.content {
    padding: 2rem;
    background: #ffffff;
    border-radius: 0.4rem;
    /* Thanks Stripe */
    box-shadow: 0 7px 14px 0 rgba(60, 66, 87, 0.1),
        0 3px 6px 0 rgba(0, 0, 0, 0.07);
}
.actions a {
    font-weight: 600;
}
th {
    white-space: nowrap;
}

/* Nav bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    padding: 2rem clamp(1rem, 2.5vw, 3rem);
    margin: 0 auto 2rem;
    box-sizing: border-box;
}
.top-nav-title a {
    font-size: 2.4rem;
    color: #d33c43;
}
.top-nav-title span {
    color: #404041;
}
.top-nav-links a {
    margin: 0 0.5rem;
}
.top-nav-title a,
.top-nav-links a {
    font-weight: bold;
}

.actions a:hover,
.actions a:focus {
    color:#2f85ae;
}

/* View action */
.view.content .text {
    margin-top: 1.2rem;
}
.related {
    margin-top: 2rem;
}

/* Flash messages */
.message {
    padding: 1rem;

    background: #eff8ff;
    color: #2779bd;

    border-color: #6cb2eb;
    border-width: 1px;
    border-style: solid;
    border-radius: 4px;
    margin-bottom: 2rem;
}
.message.hidden {
    display: none;
}
.message.success {
    background: #e3fcec;
    color: #1f9d55;
    border-color: #51d88a;
}
.message.warning {
    background: #fffabc;
    color: #8d7b00;
    border-color: #d3b800;
}
.message.error {
    background: #fcebea;
    color: #cc1f1a;
    border-color: #ef5753;
}

/* Forms */
.input.radio,
.input.checkbox {
    margin-bottom: 2.0rem;
}
.input.radio input,
.input.checkbox input {
    margin: 0;
}
.input.radio label,
.input.checkbox label {
    margin: 0;
    display: flex;
    align-items: center;
}
.input.radio label > input,
.input.checkbox label > input {
    margin-right: 1.0rem;
}
.input.radio label:first-of-type {
    margin-bottom: 2.0rem;
}

/* Paginator */
.paginator-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.paginator-summary {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.4;
}

.paginator-nav {
    margin-left: auto;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-item {
    margin: 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.65rem;
    height: 2.65rem;
    padding: 0 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    background: #fff;
    color: #475569;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a.pagination-link:hover,
a.pagination-link:focus {
    background: #eff6ff;
    border-color: #2f85ae;
    color: #2f85ae;
}

.pagination-item.active .pagination-link.is-current {
    background: #1e293b;
    border-color: #1e293b;
    color: #f8fafc;
}

.pagination-item.disabled .pagination-link {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-item.ellipsis .pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    height: 2.65rem;
    color: #94a3b8;
    font-size: 1.05rem;
    font-weight: 600;
}

.pagination-first .pagination-link,
.pagination-last .pagination-link,
.pagination-prev .pagination-link,
.pagination-next .pagination-link {
    min-width: 2.65rem;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .paginator-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .paginator-nav {
        margin-left: 0;
    }

    .pagination {
        justify-content: center;
    }
}

.asc:after {
    content: " \2193";
}
.desc:after {
    content: " \2191";
}

.plan ul {
	list-style-type: none;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.column-responsive {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media screen and (min-width: 768px) {
    .column-75 {
        flex: 1 1 calc(75% - 1rem);
    }

    .column-100 {
        flex: 1 1 100%;
    }

    .column-25 {
        flex: 1 1 calc(25% - 1rem);
    }
}

@media (min-width: 640px) {
    .row .column-responsive.column-80 {
        flex: 0 0 80%;
        max-width: none;
    }
}

.float-left {
    float: none;
}

.float-right {
    float: right;
}

.clear {
    clear: both;
}

.order-trains-editor .table-responsive,
.orders.index .content,
.orders.form.content {
    width: 100%;
    max-width: 100%;
}

.order-form-grid,
.order-view-grid {
    margin-bottom: 1.5rem;
}

.order-form-row,
.order-view-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.order-form-row > .input,
.order-form-row > .order-form-field,
.order-view-row > .order-view-field {
    flex: 1 1 0;
    min-width: 10rem;
    margin-bottom: 0;
}

.order-form-row-4 > .input,
.order-form-row-4 > .order-form-field,
.order-view-row-4 > .order-view-field {
    flex: 1 1 calc(25% - 1rem);
    min-width: 11rem;
}

.order-form-row-2 > .input,
.order-view-row-2 > .order-view-field {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 14rem;
}

.order-form-row-invoice > .input,
.order-view-row-invoice > .order-view-field {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 14rem;
}

.order-form-static {
    margin: 0.4rem 0 0;
    padding: 0.6rem 0.8rem;
    background: #f5f7fa;
    border-radius: 0.3rem;
}

.order-view-field label,
.order-view-field .order-view-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #363637;
}

.order-view-field .order-view-value {
    margin: 0;
    padding: 0.75rem 0.9rem;
    background: #f5f7fa;
    border-radius: 0.3rem;
    min-height: 2.5rem;
}

.order-view-field .order-view-value blockquote {
    margin: 0;
}

.order-view-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e4ea;
}

.order-view-section h3,
.order-view-section h4 {
    margin-top: 0;
}

.order-view-link {
    margin: 0.75rem 0 0;
}

.train-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: 1.5rem;
    align-items: start;
}

.train-view-main {
    min-width: 0;
}

.train-related-order {
    position: sticky;
    top: 1rem;
    padding: 1.25rem;
    border: 1px solid #e0e4ea;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.train-related-order h4 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    color: #1e293b;
}

.train-related-order .order-view-grid {
    margin-bottom: 0;
}

.train-related-order .order-view-row > .order-view-field {
    min-width: 0;
}

.train-related-order .order-view-link {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.train-related-order .order-view-link .button {
    margin: 0;
}

.train-form-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.train-form-fieldset legend {
    display: none;
}

.order-view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-view-header h3 {
    margin: 0;
    flex: 1 1 20rem;
}

.order-view-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0;
}

.order-view-actions form {
    display: inline-block;
    margin: 0;
}

.order-view-actions .button {
    margin: 0;
}

.order-wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding: 0;
}

.order-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 10rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e4ea;
    border-radius: 0.4rem;
    background: #f5f7fa;
    color: #606c76;
}

.order-wizard-step.is-active {
    border-color: #2980b9;
    background: #eaf3fb;
    color: #1f4f73;
    font-weight: 600;
}

.order-wizard-step.is-done {
    border-color: #27ae60;
    background: #edf9f1;
    color: #1e6b3d;
}

.order-wizard-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #fff;
    font-weight: 700;
}

.order-wizard-summary,
.order-wizard-hint {
    margin: 0 0 1rem;
    color: #606c76;
}

.order-edit-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e4ea;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}

.order-edit-header h1 {
    margin: 0;
    flex: 1 1 16rem;
}

.order-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0;
}

.order-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0 0 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e0e4ea;
}

.order-edit-actions .button,
.order-form-actions .button {
    margin: 0;
}

.employee-permissions {
    margin-top: 1.5rem;
    border: 0;
    padding: 0;
}

.employee-permissions > legend {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.employee-permissions-intro {
    margin: 0 0 1.25rem;
    color: #606c76;
}

.employee-permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.employee-permission-card {
    margin: 0;
    padding: 1rem;
    border: 1px solid #d8dde6;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.employee-permission-card .input.checkbox {
    margin-bottom: 0;
}

.employee-permission-card .input.checkbox label {
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

.employee-permission-description {
    margin: 0.5rem 0 0;
    padding-left: 2.4rem;
    color: #606c76;
    font-size: 0.88rem;
    line-height: 1.4;
}

.employee-permission-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    padding-left: 2.4rem;
    border-top: 1px solid #edf0f5;
}

.employee-permission-capabilities .input.checkbox {
    margin-bottom: 0;
}

.employee-permission-capabilities .input.checkbox label {
    font-weight: 500;
    font-size: 0.92rem;
    color: #4a5568;
}

.employee-permissions-admin {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #d8dde6;
    border-radius: 0.5rem;
    background: #fff7ed;
}

.employee-permissions-admin .input.checkbox {
    margin-bottom: 0;
}

.employee-permissions-admin .input.checkbox label {
    font-weight: 700;
}

.employee-permissions-summary ul {
    margin: 0;
    padding-left: 1.2rem;
}

@media screen and (max-width: 1100px) {
    .employee-permissions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 700px) {
    .employee-permissions-grid {
        grid-template-columns: 1fr;
    }

    .employee-permission-description,
    .employee-permission-capabilities {
        padding-left: 0;
    }
}

@media screen and (max-width: 900px) {
    .train-view-layout {
        grid-template-columns: 1fr;
    }

    .train-related-order {
        position: static;
    }

    .order-form-row-4 > .input,
    .order-form-row-4 > .order-form-field,
    .order-view-row-4 > .order-view-field,
    .order-form-row-2 > .input,
    .order-view-row-2 > .order-view-field,
    .order-form-row-invoice > .input,
    .order-view-row-invoice > .order-view-field {
        flex: 1 1 100%;
    }
}

div.DTED_Lightbox_Wrapper {
    width: min(780px, 95vw) !important;
    left: 50% !important;
    margin-left: calc(min(780px, 95vw) / -2) !important;
}

/* Error */
.error-container {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
}

@media screen and (max-width: 640px) {
    .top-nav {
        margin: 0 auto;
    }
    .side-nav {
        margin-bottom: 1rem;
        gap: 0.4rem;
    }
    .side-nav .heading {
        flex: 1 0 100%;
        border-right: 0;
        padding-right: 0;
        margin-right: 0;
        margin-bottom: 0.15rem;
    }
    .side-nav a.side-nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    .asc:after {
        content: " \2192";
    }
    .desc:after {
        content: " \2190";
    }
}


