﻿body {
    font-family: 'DM Sans', sans-serif;
    color: rgb(51, 51, 51);
    padding: 0;
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

a {
    text-decoration: none;
}

main, footer {
    max-width: 1400px;
    padding: 1rem 2rem;
    margin: 0 auto;
}

main {
    padding-top: 3rem;
}

nav {
    background-color: #0D3843;
    position: fixed;
    width: 100%;
    z-index: 9999;

    a {
        color: #fff;
    }

    a:focus-visible {
        outline: thin dotted;
    }

    .nav-content {
        margin: 0 auto;
        padding: 1rem 2rem;
        max-width: 1400px;
        display: grid;
        grid-template-columns: 2fr 1fr;
    }

    .nav-left {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;

        .nav-title {
            display: flex;
            justify-content: flex-start;
            align-items: center;

            font-size: 1.125rem;

            img {
                margin-right: 0.25rem;
            }
        }

        .nav-items {
            display: flex;
            column-gap: 1rem;

            i {
                margin-right: 0.25rem;
            }
        }
    }

    .nav-right {
        justify-self: end;
    }
}

section {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;

    &.row {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;

        & > * {
            flex: 1;
        }
    }
}

input, select {
    height: 1rem;
    font-family: inherit;
    border: 1px solid rgb(204, 204, 204);
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    padding: 0.5rem 1rem;
}

button.link-button {
    font-family: inherit;
    border: none;
    background-color: #fff;
    padding: 0.5rem;
    cursor: pointer;
}

select, button.link-button {
    height: 2rem;
}

input:focus, select:focus, button:focus-visible, details > summary:focus-visible {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}

label {
    font-weight: bold;
}

button {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 0.25rem;

    &.primary {
        color: #fff;
        background-color: #881B4E;
    }

    &.primary:hover {
        color: #fff;
        background-color: #5E1336;
    }

    &.secondary {
        color: #000;
        background-color: #EBEBF3;
    }

    &.secondary:hover {
        color: #000;
        background-color: #cccce0;
    }
}

details {
    margin-top: 1.5rem;
    border: 1px solid #7f7f7f;
    border-radius: 0.25rem;
    overflow: auto;

    & > summary {
        cursor: pointer;
        display: grid;
        grid-template-columns: 2fr 2fr 1fr 1fr;
        gap: 1rem;
        flex-wrap: wrap;
        list-style: none;
        background-color: rgb(245, 245, 245);
        font-size: 1rem;
        padding: 1rem;

        &::marker {
            display: none;
        }

        &.border {
            border-bottom: 1px solid #7f7f7f;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
        }

        & > div:last-child not:first-child {
            text-align: right;
        }
    }

    &.primary {
        border-color: #881B4E;

        & > summary {
            color: #fff;
            background-color: #881B4E;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
        }
    }

    section {
        border: none;
    }
}

details > summary.no-pointer {
    cursor: default !important;
}

[role="alert"] {
    margin-top: 1.5rem;
    border: 1px solid #7f7f7f;
    border-radius: 0.25rem;
    overflow: auto;
    padding: 1rem;

    display: grid;
    grid-template-columns: 22px 1fr auto; /* icon | text | actions */
    align-items: start;
    column-gap: 1rem;

    & > .alert-actions {
        display: flex;
        column-gap: 0.5rem;
    }

    &.alert-info {
        color: #31708f;
        background-color: #d9edf7;
        border-color: #bce8f1;
    }

    &.alert-warning {
        color: #111;
        background-color: #F2B94C;
        border-color: #f9ddaa;
    }
}

dialog {
    border: 1.5px solid #7f7f7f;
    margin: 100px auto;
    text-align: center;
    background-color: #d9edf7;
    padding: 1.5rem 2rem;
    border-radius: 6px;

    &::backdrop {
        background: rgba(0, 0, 0, 0.5); /* dim the page */
    }

    & > p {
        color: #0D3843;
        margin: 0;
    }

    & > .spinner {
        height: 40px;


        & div {
            background-color: #0D3843;
            height: 100%;
            width: 6px;
            display: inline-block;
            animation: sk-stretchdelay 1.2s infinite ease-in-out;
        }

        & .rect1 {
            animation-delay: -1.2s
        }

        & .rect2 {
            animation-delay: -1.1s
        }

        & .rect3 {
            animation-delay: -1.0s
        }

        & .rect4 {
            animation-delay: -0.9s
        }

        & .rect5 {
            animation-delay: -0.8s
        }
    }
}

@keyframes sk-stretchdelay {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1.0);
    }
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-buttons {
    display: flex;
    flex-direction: row;
    align-items: end;
    column-gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;

    &.table-striped > tbody > tr:nth-of-type(odd) {
        background-color: #f9f9f9;
    }

    &.table-striped > tbody > tr > td {
        border-top: 1px solid #ddd;
    }

    & > thead > tr > th {
        text-align: left;
        border-bottom: 2px solid #ddd;
    }

    & > tbody > tr > td {
        padding: 0.25rem;

        &.text-right {
            text-align: right;
        }
    }
}

.transactions {
    margin-top: 2rem;
}

.transactions > .title, .transactions > .transaction {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr 3fr;
    gap: 1rem;
}

.original-transaction > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
}


.customer-details {
    dl, dt, dd {
        margin: 0
    }

    dl {
        padding: 0.5rem 0;
    }

    & .row1 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .props {
        dl {
            display: grid;
            grid-template-columns: 1fr auto;
            column-gap: 1rem;
            margin: 0;
        }

        dt {
            grid-column: 1;
            margin: 0;
        }

        dd {
            grid-column: 2;
            margin: 0;
            justify-self: end;
            text-align: right;
        }
    }

    .row2 {
        dl {
            display: flex;
            column-gap: 1rem;
            border-top: 1px solid #ddd;
        }
    }
}

.collapse {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    body {
        color: #eee;
        background: #282828;
    }

    main a {
        color: #eee;
    }

    section {
        border-color: #757575;
    }

    details > summary {
        background-color: #202020;
    }

    input, select, button.link-button {
        color: #eee;
        background-color: #282828;
        border-color: #757575;
    }

    table {
        &.table-striped > tbody {
            & > tr:nth-of-type(odd) {
                background-color: #282828;
            }

            & > tr:nth-of-type(even) {
                background-color: #202020;
            }

            & > tr > td {
                border-top: 1px solid #757575;
            }
        }

        & > thead > tr > th {
            border-bottom-color: #757575;
        }
    }
}

.hidden {
    display: none;
}