@import url('https://fonts.googleapis.com/css?family=Montserrat:500,500i,700,700i');


/* Base style */

* {
    box-sizing: border-box;
}

html {
    font-family: Montserrat, "DejaVu Sans", "Bitstream Vera Sans", Verdana, sans-serif;
    font-weight: 700;
    font-size: .75vw;
    line-height: 1.2;
    --background-color: var(--zone-color, #0B045D);
    --text-color: var(--base-color, white);
    --text-inverted-color: var(--base-inverted-color, black);
    --highlight-color: var(--accent-color, #AD7B00);
    --highlight-color-rgb: var(--accent-color-rgb, 173,123,0);
    background-color: var(--background-color);
    overflow: hidden;
}

body {
    color: var(--text-color);
    fill: var(--text-color);
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    font-size: 115%;
}

a, a:active, a:visited {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 1rem 0;
}

h1 {
    font-size: 3.6em;
}

h2 {
    font-size: 2.7em;
}

h3 {
    font-size: 1.8em;
}

h4 {
    font-size: 1.35em;
}

h5, h6 {
    font-size: 1em;
}

svg {
    fill: inherit;
}


/* Forms */

input[type],
textarea,
select {
    background: var(--text-color);
    border: 1px solid var(--highlight-color);
    color: var(--text-inverted-color);
    padding: .25rem .5rem;
    width: 100%;
    resize: vertical;
}

input[type]:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid var(--highlight-color);
    box-shadow: 0 0 1rem var(--highlight-color);
}

input[type][disabled],
textarea[disabled],
select[disabled] {
    user-select: none;
    pointer-events: none;
    background: transparent;
    color: var(--text-color);
}

.button,
input[type=button],
button {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
    padding: 1.5em;
    display: inline-block;
    text-transform: inherit;
}

.action-ok,
.main-button {
    background-color: rgba(var(--highlight-color-rgb), 0.5);
}

form .input {
    margin: 1em 0;
}

form .input label {
    display: block;
    margin-bottom: .5em;
}


/* Utility classes */

.shaded {
    background-color: rgba(0, 0, 0, 0.125);
}

.button:hover,
input[type=button]:hover,
button:hover,
.selected {
    background-color: rgba(255, 255, 255, 0.25);
}

.action-ok:hover,
.main-button:hover {
    background-color: rgba(var(--highlight-color-rgb), 0.75);
}

a:hover,
.accent {
    color: var(--highlight-color);
    border-color: var(--highlight-color);
    fill: var(--highlight-color);
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.icon {
    height: 4rem;
    width: auto;
    display: inline-block;
    -webkit-mask-size: 100%;
    -webkit-mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-size: 100%;
    mask-position: center center;
    mask-repeat: no-repeat;
}

.row {
    display: flex;
}

.row .column {
    flex:1;
}

.row .column.right {
    margin-left: 10px;
}


@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
.spinning {
    animation: spin 2s linear infinite;
}

.scroller {
    overflow: auto;
    overflow: overlay;
}

.message {
    margin: 2rem;
    padding: 1rem 3rem 1rem 1rem;
    position: relative;
}

.message-hide {
    cursor: pointer;
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    padding: 1rem 1rem;
    font-size: 200%;
    line-height: 1.2rem;
}

.success {
    background: #00B329;
}

.warning {
    background: #ff9b00;
}

.error {
    background: #ff0400;
}

.message.notes {
    background: rgba(255, 255, 255, 0.25);
    animation: shadowGlow 5s linear infinite;
}

.note-trash {
    cursor: pointer;
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    padding: 1rem 1rem;
    font-size: 200%;
    line-height: 1.2rem;
}

.note-trash .icon {
    width: 1.2rem;
    height: 1.2rem;
}

.bordered {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.entry-notes {
    cursor: pointer;
}

.entry-notes + .entry-notes {
    margin-top: -1rem;
}

.currency {
    white-space: nowrap;
}

.jumbo {
    font-size: 2em;
}

.spaced {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.text-center {
    text-align: center;
}

.employee {
    text-transform: none;
}

.employee .key-name::before,
.employee .key-name::after {
    content: "★";
    font-size: .25em;
    line-height: 0;
    display: inline-block;
    margin: .5em;
    transform: translateY(-1em);
}

.zero .key-name::before,
.zero .key-name::after {
    content: "[";
    display: inline-block;
    opacity: 0.5;
}

.zero .key-name::after {
    content: "]";
}


/* Main interface */

.interface {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 7rem 1fr;
    grid-template-columns: 1rem 1.5fr 2fr 3fr 2fr [overlay] 3fr;
    grid-template-areas: 
      "decoration sidebar header-left header-center header-right header-right"
      "decoration sidebar content content content content";
    text-transform: uppercase;
}

.interface::before {
    content: " ";
    display: block;
    grid-area: decoration;
    background: linear-gradient(to bottom, #ff0400 0%,#ff0400 16.666%,#ff9b00 16.666%,#ff9b00 33.333%,#FEFE00 33.333%,#FEFE00 50%, #00B329 50%,#00B329 66.666%,#0D38F0 66.666%,#0D38F0 83.333%,#AF00C5 83.333%,#AF00C5 100%);
}

.interface > .header {
    grid-row: 1/2;
    grid-column: 3/-1;
    border-bottom: 3px solid var(--highlight-color);
}

.interface .header-left {
    flex: 1 1 auto;
    grid-area: header-left;
    justify-content: flex-start;
    padding-bottom: 3px;
}

.interface .header-center {
    flex: 1 1 auto;
    grid-area: header-center;
    border-left: 3px solid var(--highlight-color);
    border-right: 3px solid var(--highlight-color);
    margin: 0 -1.5px;
    justify-content: center;
    padding-bottom: 3px;
}

.interface .header-right {
    flex: 1 1 auto;
    grid-area: header-right;
    justify-content: flex-end;
    padding-bottom: 3px;
}

.interface > .sidebar {
    grid-area: sidebar;
    border-right: 3px solid var(--highlight-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    font-size: 1em;
}

.interface > .sidebar footer {
    font-size: 0.8em;
    margin-top: 20px;
}

.site-logo-wrapper {
    min-height: 7rem;
}

.site-logo-wrapper a {
    display: block;
}

.site-logo-wrapper a:hover {
    color: inherit;
}

.site-logo {
    height: 4rem;
    width: auto;
    margin: .25rem auto;
    max-width: 100%;
    fill: currentColor;
}

.site-logo-operator {
    font-size: 0.8em;
    text-align: center;
}

.user-navigation ul,
.user-navigation ul li {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.user-navigation ul li.jumbo {
    font-size: 160%;
}

.user-navigation ul li+li {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.user-navigation ul li.spacer {
    border-top-width: 0;
    height: 5rem;
}

.user-navigation ul li.spacer+li {
    border-top-width: 0;
}

.user-navigation ul li a {
    display: block;
    padding: 1rem 0;
}

.user-actions {
    width: 100%;
    font-weight: 500;
}

.user-actions .icon {
    height: 2rem;
    margin-right: .5rem;
}

.user-actions form button {
    padding: .5rem;
    margin-left: auto;
    margin-right: 0;
    display: block;
}

.user-actions a {
    font-size: 1em;
}

.interface > .overlay {
    grid-column: overlay / span 1;
    grid-row: header-right-end / span 1;
    background-color: --var(--background-color);
    box-shadow: -.5rem 0 .5rem rgba(0, 0, 0, 0.25);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.overlay-content {
    height: 0;
    flex: 1 1 auto;
    position: relative;
}

.overlay-content-scroller {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.overlay-container {
    padding: 1.5rem;
}

.overlay .actions-grid {
    padding: 1.5rem;
    grid-template-columns: 1fr;
    grid-template-areas: "col";
}

.actions-grid {
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
      "col col";
    grid-gap: 1rem;
}

.actions-grid .wide {
    grid-column-start: 1;
    grid-column-end: 3;
    padding: 1.5rem;
}

.interface > .content {
    grid-area: content;
    background-color: var(--zone-color, transparent);
}

.interface > .overlay + .content,
.interface > .content.has-overlay {
    grid-column-end: overlay;
}

.wrapper {
    margin: 4.3vw auto;
    width: 80%;
}

.wrapper-tight {
    margin: 4.3vw auto;
    width: 40%;
}

.wrapper-overlay {
    width: 71.4285%;
}

.os-content::after {
    display: block !important;
    content: "";
    width: 100% !important;
    border-bottom: 1px solid transparent;
}


/* Card input */
.card-information {
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 4fr 3fr;
    gap: 1rem;
}

.card-input-wrapper .input {
    margin: 0;
}

.card-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 0;
    padding: .5rem;
}

.card-buttons-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "space";
    min-height: 4rem;
}

.card-buttons-wrapper > * {
    grid-area: space;
    display: none;
}

.card-buttons-wrapper.loading .card-loading {
    display: flex;
}

.card-buttons-wrapper.loaded .card-buttons {
    display: grid;
}

.card-buttons {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.card-loading {
    align-items: center;
    justify-content: center;
}

.card-button,
.card-button:hover {
    position: relative;
    background: none;
}

.card-button::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

button.card-button:hover::before {
    opacity: 0.5;
}

.button-status::before {
    background-color: #0D38F0;
}

.button-status.valid::before {
    background-color: #00B329;
}

.button-notes::before {
    background-color: #ff9b00;
}

.button-status.error::before,
.button-blacklist::before {
    background-color: #ff0400;
}

.card-loading .icon {
    height: 2rem;
}

.card-loading .icon.jumbo {
    height: 4rem;
}

.button-animated {
    animation: shadowGlow 5s linear infinite;
}

@keyframes shockwaveJump {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.2);
    }
    25% {
        transform: scale(0.9);
    }
    27.5% {
        transform: scale(1.1);
    }
    30% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1);
    }
}

@keyframes shadowGlow {
    0%, 100% {
        box-shadow: 1rem 0 1rem rgba(255, 4, 0, 0.5);
    }
    25% {
        box-shadow: 0 1rem 1rem rgba(254, 254, 0, 0.5);
    }
    50% {
        box-shadow: -1rem 0 1rem rgba(0, 179, 41, 0.5);
    }
    75% {
        box-shadow: 0 -1rem 1rem rgba(13, 56, 240, 0.5);
    }
}


/* UI grid */

table.ui-grid {
    width: 100%;
    table-layout: fixed;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

table.ui-grid td {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.05);
    padding: .5rem;
    height: 8.6vw;
    text-align: center;
    position: relative;
}

table.ui-grid tr.spacer td {
    height: 1vw;
}

table.ui-grid td.key-cell h1,
table.ui-grid td.numbering-cell h1 {
    line-height: 4.14rem;
    font-size: calc(4.14rem * 3 / var(--label-length));
}

table.ui-grid td.key-cell h1.employee,
table.ui-grid td.key-cell h1.zero {
    line-height: 4.14rem;
    font-size: calc(4.14rem * 3 / calc(var(--label-length) + 1));
}

table.ui-grid td.key-cell h1 small {
    line-height: 1;
    font-size: 1.24rem;
}

table.ui-grid td.key-cell.open {
    background-color: #ff0400;
    color: white;
}

table.ui-grid td.key-cell.open.selected,
table.ui-grid td.key-cell.open:hover {
    background-color: #e00400;
}

table.ui-grid td.clickable {
    cursor: pointer;
}

table.ui-grid td.shaded {
    background-color: rgba(0, 0, 0, 0.125);
}

table.ui-grid td.disabled {
    opacity: 1;
}

table.ui-grid td.disabled > * {
    opacity: 0.5;
}

table.ui-grid td.clickable:hover,
table.ui-grid td.selected {
    background-color: rgba(255, 255, 255, 0.25);
}

table.ui-grid td.grid-label {
    padding: .5rem 1rem;
    text-align: left;
}

table.ui-grid tr:first-child > td {
    border-top-width: 0;
}

table.ui-grid tr:last-child > td {
    border-bottom-width: 0;
}

table.ui-grid tr > :first-child {
    border-left-width: 0;
}

table.ui-grid tr > :last-child {
    border-right-width: 0;
}

button .icon {
    display: block;
    margin: 1rem auto;
}

.ui-grid td p,
.ui-grid td .icon {
    display: block;
    margin: .5rem auto;
}

.ui-grid td h1, .ui-grid td h2 {
    line-height: 1;
}

.ui-grid td h1 small {
    display: block;
    font-size: 30%;
    height: 0;
    overflow: visible;
}

.ui-grid td h1 small.above-key {
    transform: translateY(-1em);
    font-weight: 400;
}


/* Keys page */
.keys-screen-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.keys-grid-wrapper {
    flex: 1 1 0;
}

.keys-jump-table {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.keys-jump-table button {
    padding: .75rem;
    margin: 1rem;
    width: calc(10% - 2rem);
}


/* Details grid */

.details {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-gap: 1rem;
}

.detail-label {
    grid-column-start: 1;
}

.detail-content {
    grid-column-start: 2;
    font-weight: 400;
}


/* Actions */

.action-bar {
    display: flex;
    align-items: center;
    font-size: 1.1em;
}

.action {
    padding: .5rem;
    flex: 0 0 7.5rem;
    text-align: center;
}

.wide-action {
    padding: 1rem;
    flex: 0 0 auto;
}

.left-action {
    text-align: initial;
}

.action-bar .icon {
    height: 3rem;
}

.action .label {
    display: block;
}


/* Products in the cart */

table.products {
    width: 100%;
}

table.products tr {
    border-bottom: 1px solid var(--text-color);
    text-align: left;
}

table.products tfoot tr {
    border-top: 4px double var(--text-color);
    border-bottom: 0;
}

table.products td,
table.products th {
    padding: 1rem .25rem 1rem 0;
    height: 3.2rem;
}

table.products td.row-icon {
    width: 2.5em;
}

table.products td:last-child,
table.products th:last-child {
    padding-right: 0;
    text-align: right;
}

table.products .row-icon button {
    margin: -1em 0;
    padding: .25em 0;
    width: 1.6em;
    height: 1.6em;
    text-align: center;
    line-height: 0em;
    vertical-align: middle;
}

table.products .row-icon button.checked::after {
    content: '\2713';
    display: inline;
}

table.products .annotation {
    display: block;
    opacity: 0.75;
    margin: .25rem 0;
}

table.products .annotation.error {
    padding: .25rem;
    opacity: 1;
}

table.products .content-cell {
    padding-right: .5rem;
}

table.products .content-cell select {
    margin: .25rem 0;
}

.actions-grid button {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.actions-grid button .icon {
    height: 2rem;
}


/* Dialogs */

.dialog {
    min-width: 36rem;
    max-width: 60rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem;
    z-index: 100;
}

.large-dialog {
    max-width: 100vw;
}

.dialog::before {
    content: "";
    display: block;
    background-color: rgba(255, 255, 255, 0.5);
    position: fixed;
    width: 400vw;
    height: 400vh;
    top: -100vh;
    left: -100vw;
    z-index: -2;
}

.dialog::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color);
    box-shadow: 0 .5rem 2.5rem rgba(0, 0, 0, 0.25);
    z-index: -1;
}

.dialog > div + div {
    margin-top: 1rem;
}

.dialog .dialog-actions {
    text-align: right;
}

.dialog .dialog-actions button {
    padding: 1rem;
}

.spaced-button + .spaced-button {
    margin-left: 1rem;
}


/* Cash dialog */

.cash-sum-table {
    width: 100%;
    table-layout: fixed;
}

.cash-sum-table td,
.cash-sum-table th {
    padding: .25rem;
    text-align: right;
}

.cash-sum-table td:first-child,
.cash-sum-table th:first-child {
    padding-left: 0;
}

.cash-sum-table td:last-child,
.cash-sum-table th:last-child {
    padding-right: 0;
}

.cash-sum-table tfoot th:first-child {
    text-align: unset;
}

.calculator-button {
    display: inline-block;
    cursor: pointer;
    width: 0;
    overflow: visible;
    margin-left: -3.5rem;
    padding: .25rem;
    right: 0;
    vertical-align: bottom;
    margin-bottom: -0.125rem;
}

.calculator-button .icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-inverted-color);
    fill: var(--text-inverted-color);
}


/* Keys dialog */

.dialog-key-grid {
    width: calc(100vw - 12rem);
    height: calc(100vh - 24rem);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.dialog-key-grid svg {
    margin-top: 4rem;
}


/* Media queries */

@media screen and (max-width: 1280px) {
    html {
        font-weight: 400;
        font-size: .875vw;
    }

    h4, h5, h6, th {
        font-weight: 400;
    }
}

@media screen and (min-width: 1920px) {
    html {
        font-size: 15px;
    }
}
