:root {
    --accent-color: rgb(232,90,43);
    --header-color-r: #151515;
    --header-color-l: #1a1a1a;
    --bg-color: #f0f0f0;
    --card-color: #fff;
    --text-color: #000;
    --text-color-2: #707070;

    --good: #60c591;
    --bad: #FF7F7F;

    --header-height: 60px;

    --small-text:  clamp(0.9rem, 3vw, 1.1rem);
    --medium-text: clamp(1.15rem, 4.5vw, 1.35rem);
    --large-text:  clamp(1.25rem, 3vw, 1.5rem);
    --header-text: clamp(1.5rem, 4vw, 1.75rem);
}

html {
    visibility: visible;
    opacity: 1;
}

p, span, h1, h2, h3, h4, h5, label, input, button {
    margin: 0;
    padding: 0;
    color: var(--text-color);
    font-family: "ff-good-web-pro", sans-serif;
}

body {
    position: relative;
    background-color: var(--bg-color);
    margin: 0;
    height: 100vh;
}

header {
    position: relative;
    display: flex;
    background-color: var(--header-color-r);
    background: linear-gradient(90deg, var(--header-color-r), var(--header-color-l));
    height: var(--header-height);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#bars {
    display: inline-flex;
    align-items: center;
    height: 100%;
    width: 1.5rem;
    margin-left: 1rem;
}

#bars > img {
    width: 100%;
}

.logo {
    display: inline-block;
    width: max-content;
    height: 40%;
    margin: calc(var(--header-height) * 0.3) 0;
}

#rc-logo {
    margin-left: 17.5px;
}

body > div:first-of-type {
    position: relative;
    display: flex;
}

.horiz {
    display: flex;
}

.center {
    align-items: center;
}

.wrap {
    flex-wrap: wrap;
}

.nowrap {
    white-space: nowrap;
}

.verti {
    display: flex;
    flex-direction: column;
}

.hide {
    display: none !important;
}

/* Navigation *****************************************************************/

nav {
    position: relative;
    background-color: var(--card-color);
    height: calc(100vh - var(--header-height));
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

nav > a.tab:first-child {
    margin-top: 15px;
}

nav > a.tab {
    display: flex;
    align-items: center;
    padding: 7.5px 20px 7.5px 17.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

nav > a.tab > * {
    opacity: 0.75;
    transition: margin linear 0.1s;
}

nav > a.tab > div {
    width: 2rem;
    height: 0.8rem;
}

nav > a.tab > div > img {
    display: inherit;
    height: 100%;
}

nav > a.tab > p {
    font-size: 1rem;
}

nav > a.tab:not(.active):hover > * {
    margin-left: 5px;
    margin-right: -5px;
}

nav > a.tab.active {
    background-color: var(--header-color-l);
    box-shadow: -4px 0 5px rgba(0,0,0,0.25);
}

nav > a.tab.active > * {
    opacity: 1;
}

nav > a.tab.active > div > img {
    filter: invert(100%);
}

nav > a.tab.active > p {
    color: var(--card-color);
}

nav.collapsed > a.tab {
    padding: 7.5px 10px
}

nav.collapsed > a.tab > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

nav.collapsed > a.tab > p {
    display: none;
}

nav > a#add-unit > div {
    height: 1.05rem;
}

nav > #account {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0 12px 0;
}

nav > #account > p {
    color: var(--text-color-2);
    font-size: 0.95rem;
    max-width: 80%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

nav > #account > #logout {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    padding: 6px 0;
}

nav > #account > #logout > img {
    height: 1rem;
    margin-right: 10px;
}

nav.collapsed > #account > p {
    display: none;
}

nav.collapsed > #account > #logout > p {
    display: none;
}

header > #partner-account {
    position: absolute;
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    padding-right: 20px;
    padding-left: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 1px solid #999;
}

header > #partner-account > p {
    color: #EEE;
    margin-top: 7.5px;
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

header #partner-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    padding-top: 3px;
}

header #partner-logout > img {
    height: 1rem;
    margin-right: 10px;
}

header #partner-logout > p {
    color: #FFF;
}

header > #show-login {
    position: absolute;
    right: 20px;
    height: 100%;
    display: flex;
    align-items: center;
}

header > #show-login > button {
    font-size: 0.95rem;
    padding: 4px 12.5px;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.01);
    cursor: pointer;
}

/* Main ***********************************************************************/

main {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.card-row {
    width: calc(100% - 40px);
    display: flex;
    flex-direction: row;
    margin: 0 20px;
    flex-wrap: wrap;
    column-gap: 20px;
}

.card-row > .big {
    flex: 2 !important;
}

.card-row > .card {
    margin-top: 20px;
    flex: 1;
}

.card {
    position: relative;
    border-radius: 5px;
    padding: 15px;
    background-color: var(--card-color);
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    max-width: calc(100vw - 70px);
}

.card.main {
    width: calc(100% - 70px);
    margin: 0 20px;
    margin-top: 20px; /* TEMPORARY */
}

.card.error {
    font-size: 1.05rem;
    background-color: hsl(0 65% 80% / 1);
    color: rgb(37, 2, 1);
    min-height: unset;
}

.card.error > p {
    margin-bottom: 5px;
}

.card.error > p:last-child {
    margin-bottom: 0;
}

.card.main:last-child {
    margin-bottom: 20px;
}

.card.top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.card h2 {
    font-size: 2rem;
    font-weight: 600;
}

.card h3 {
    font-size: var(--header-text);
    font-weight: 600;
}

/* Helpers ********************************************************************/

.tag-cell {
    padding: 0 10px !important;
}

.tags {
    height: 100%;
    display: flex;
    align-items: center;
}

.tags > div {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 100vw;
    margin-right: 5px;
    cursor: default;
}

.tags > div:last-child {
    margin-right: 0;
}

.tags > div > span {
    font-size: 0.85rem;
}

.tag.add {
    border: 1px solid black;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-tip {
    position: relative;
}

.tool-tip .tool-tip-text {
    display: none;
    width: 95px;
    height: max-content;  
    white-space: normal;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: #FFF;
    text-align: center;
    padding: 5px 5px;
    border-radius: 5px;
    top: calc(100% + 5px);
    left: 50%;
    margin-left: -50px; 
    position: absolute;
    z-index: 1;
}
  
.tool-tip:hover .tool-tip-text {
    display: unset;
}

.tool-tip .tool-tip-text::after {
    content: " ";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.5) transparent;
}

.number {
    font-variant-numeric: tabular-nums;
}

.number.big {
    font-size: 2.75rem;
    height: 3rem;
    letter-spacing: 0.05rem;
    width: 100%;
    text-align: center;
}

.status {
    width: 100%;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
}

.status > span:first-child {
    margin-right: 10px;
}

.dot {
    font-size: 1.4rem;
    line-height: 0.714rem;
}

.dot.good {
    color: var(--good);
}

.dot.bad {
    color: var(--bad);
}

.space {
    gap: 10px;
}

button.big {
    display: flex;
    font-size: var(--small-text);
    font-weight: 500;
    padding: clamp(3px, 0.75vw, 5px) clamp(7.5px, 2vw, 12.5px);
    border-radius: 100vw;
    background: none;
    border: 1.25px solid #000;
    align-items: center;
    opacity: 0.8;
    white-space: nowrap;
    transition: opacity 0.05s linear;
}

button.mid {
    display: flex;
    font-size: 1rem;
    font-weight: 500;
    padding: 3px 7.5px;
    border-radius: 100vw;
    background: none;
    align-items: center;
    color: var(--text-color-2);
    border: 1px solid var(--text-color-2);
    white-space: nowrap;
    transition: background-color 0.05s linear;
}

button.mid > img {
    margin-right: 5px;
}

button.final {
    display: flex;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 5px 15px;
    border-radius: 100vw;
    background: none;
    border-width: 1.5px;
    border-style: solid;
    white-space: nowrap;
}

button.big:active,
button.final:active {
    opacity: 1;
}

button.big > img,
button.final > img {
    margin-right: 10px;
    height: 20px;
}

/* Forms **********************************************************************/

.required {
    display: inline-block;
    margin-bottom: -5px;
    color: darkred;
}

form label {
    font-size: 1.1rem;
}

form input[type=text],
form input[type=password] {
    font-size: 1rem;
    height: 1.25rem;
    border: 1px solid var(--text-color-2);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 7.5px;
}

form table {
    margin-top: 10px;
    margin-right: 20px;
}

form .tool-tip  {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    margin-left: 10px;
}

form .tool-tip > .tool-tip-text {
    font-family: sans-serif;
    width: 250px        !important;
    margin-left: -133px !important;
    text-align: left    !important;
    padding: 10px       !important;
}

form .tool-tip > .tool-tip-text.small {
    width: 200px        !important;
    margin-left: -109px !important;
}

form .tool-tip > img {
    opacity: 0.5;
    width: 1.1rem;
}

form select {
    font-size: 1rem;
    border: 1px solid var(--text-color-2);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 5px;
}

form input[type=file] {
    display: none;
}

.custom-file-upload {
    display: flex;
    font-size: 1rem;
    font-weight: 500;
    padding: 3px 7.5px;
    border-radius: 100vw;
    background: none;
    align-items: center;
    border: 1px solid var(--text-color-2);
    width: fit-content;
}

.top {
    margin-top: 10px;
}

.bottom {
    margin-bottom: 10px;
}

.nudge {
    margin-left: 5px;
}

label.nudge {
    margin-left: 10px;
}

.italic {
    font-style: italic;
}


.check {
    display: block;
    position: relative;
    height: 17.5px;
    width:  17.5px;
    margin-top: 2px;
    border: 1px solid var(--text-color-2);
    padding: 0.5px;
    border-radius: 3px;
    margin-left: 7.5px;
    cursor: pointer;
    user-select: none;
}

.check:has(input:checked) {
    border: 1.5px solid var(--accent-color);
    padding: 0;
    box-shadow: 0 0 5px rgba(232, 90, 43, 0.2);
}

.check input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: none;
    position: absolute;
    top: -22.5%;
    left: 12.5%;
    height: 110%;
    width:  110%;
}

.check input:checked ~ .checkmark {
    display: unset;
}

.outbound::after {
    content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
    margin: 0 3px 0 5px;
}

/* Image Helpers **************************************************************/

.image-fit {
    display: flex;
    height: 100%;
    width: 0.95em;
    margin-right: 7.5px;
}

.image-big {
    font-size: 3rem;
}

.image-center {
    margin: auto;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* Modals *********************************************************************/

#modal-background {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(7.5px);
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow-y: auto;
}

#modal-background.show {
    display: flex;
}

#modal-background > * {
    display: none;
}

#modal-background > *.show {
    display: unset;
}

.modal {
    border-radius: 5px;
    background-color: var(--card-color);
    padding: 15px 20px;
    max-width: calc(90vw - 30px);
    max-height: 90%;
    overflow-y: auto;
}

.modal .text {
    max-width: 400px;
}

.modal .text.side {
    color: var(--text-color-2);
}

.modal .note {
    margin-top: 1.5px;
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: var(--text-color-2);
}

.modal h3:first-child {
    margin-top: 5px;
}

.modal h3 {
    font-weight: 600;
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 7.5px;
}

.modal h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal button {
    border: 1.5px solid #000;
    color: #000;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 1rem;
    background: none;
}

.modal .button-bank {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 10px;
}

.modal .button-bank .suggested {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.modal .button-bank .suggested.good {
    color: green;
    border-color: green;
}

.modal .button-bank .suggested.bad {
    color: darkred;
    border-color: darkred;
} 

.modal td {
    color: var(--text-color);
    font-family: "ff-good-web-pro", sans-serif;
}

.modal tr > td:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(60vw - 20px);
}

.modal td.big {
    font-size: 1.1rem;
}

.modal form table {
    border-collapse: collapse;
    margin-top: 5px;
    width: min-content;
}

.modal table tr > td:first-child {
    padding-right: 10px;
}

.modal table.minor tr > td:first-child {
    color: var(--text-color-2);
}

.modal form table input[type=text] {
    margin-left: 0;
    margin-bottom: 5px;
}

.modal a {
    text-decoration: none;
}

.modal pre {
    font-size: 1.1rem;
    color: darkred;
}

.modal hr {
    border: none;
    border-top: 1px solid #000;
    margin: 10px 0;
}

#loading {
    width: 75px;
    height: 75px;
}

#loading.spin {
    display: unset;
    animation: spin 1s infinite steps(8);
}

@keyframes spin {
    from {transform:rotate(0deg);}
    to {transform:rotate(360deg);}
}

.spinner {
    width: 30px;
    height: 30px;
    margin: 5px auto 0 auto;
    animation: spin 1s infinite steps(8);
}

/******************************************************************************/

.copyable {
    position: relative;
    width: 100%;
}

.copy {
    position: absolute;
    right: 0.5rem;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.copy > div {
    border-radius: 5px;
    height: 1.75rem;
    width: 1.75rem;
    /* background-color: rgba(0, 0, 0, 0.2); */
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 1);
    background-image: url("/static/imgs/icons/copy.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 65%;
}

.copy > div:active {
    background-color: #EEE;
}