:root {
    --primary-color-10: hsl(260, 100%, 90%);
    --primary-color-90: hsl(260, 100%, 75%);
    --gray-color-10: hsl(0, 0%, 95%);
    --gray-color-50: hsl(0, 0%, 80%);
    --success-color-10: hsl(94, 100%, 80%);
    --success-color-50: hsl(94, 100%, 30%);
    --info-color-10: hsl(172, 100%, 90%);
    --info-color-50: hsl(172, 100%, 30%);
    --warning-color-10: hsl(60, 100%, 80%);
    --warning-color-50: hsl(60, 100%, 40%);
    --error-color-10: hsl(345, 100%, 80%);
    --error-color-50: hsl(345, 100%, 60%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/**
 * Tag styles
 */
html,
body {
    height: 100vh;
    margin: 0;
    font-family: sans-serif;
}

a {
    color: black;
    text-decoration: none;
}

a:hover {
    color: black;
}

/**
 * Main page grid
 */
#main-page {
    display: grid;
    grid-template-rows: minmax(min-content, 1rem) auto;
    grid-template-areas: "header" "content";
    height: 100vh;
}

#page-header {
    grid-area: header;
    background-color: var(--primary-color-10);
}

#main-menu {
    height: 100%;
    font-size: 1.25rem;
    font-weight: bold;
}

#main-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: stretch;
}

#main-menu li {
    flex: 10% 0 0;
    text-align: center;
}

#main-menu a {
    display: block;
    width: 100%;
    height: 100%;
    padding: 1.15em 0.50em;
    transition: background-color 350ms ease-out;
}

#main-menu a:hover,
#main-menu a:focus {
    background-color: var(--primary-color-90);
}

#page-content {
    grid-area: content;
    padding: 0.5em 2em;
    position: relative;
}

/**
 * ID definitions
 */
#login-form {
    width: 20em;
}

/**
 * Page messages
 */
#messages {
    position: absolute;
    top: 1em;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 25%;
}

.messages__message {
    border: 1px solid var(--gray-color-50);
    background-color: white;
    padding: 1em 0.5em;
    text-align: center;
}

.messages__message--success {
    border-color: var(--success-color-50);
    background-color: var(--success-color-10);
    cursor: pointer;
}

.messages__message--info {
    border-color: var(--info-color-50);
    background-color: var(--info-color-10);
}

.messages__message--warning {
    border-color: var(--warning-color-50);
    background-color: var(--warning-color-10);
}

.messages__message--error {
    border-color: var(--error-color-50);
    background-color: var(--error-color-10);
}

/**
 * Table classes
 */
.table {
    border-collapse: collapse;
    margin-bottom: 2em;
}

.table td,
.table th {
    border: 1px solid var(--gray-color-50);
    padding: 0.25em 0.5em;
}

.table tbody > tr:hover {
    background-color: var(--gray-color-10);
}

.table--full {
    width: 100%;
}

.table--half {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.table--without-border td,
.table--without-border th {
    border: none;
}

.table__cell-15ch {
    width: 15ch;
}

.table__cell-10ch {
    width: 10ch;
}

.table__cell-6ch {
    width: 6ch;
}

.table__cell-3ch {
    width: 3ch;
}

/**
 * Form classes
 */
.form {
    max-width: 50%;
    margin: 0 auto;
}

.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="number"],
.form select {
    width: 100%;
    height: 2.25em;
    font-family: sans-serif;
    border: 1px solid var(--gray-color-50);
    border-radius: 0.50em;
}

.form textarea {
    width: 100%;
    height: 10ch;
    font-family: sans-serif;
    border: 1px solid var(--gray-color-50);
    border-radius: 0.50em;
    resize: vertical;
}

.form input:focus,
.form textarea:focus {
    outline: 1px solid var(--primary-color-90);
}

.button {
    display: inline-block;
    font-family: sans-serif;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.50em 1.75em;
    margin-bottom: 0.50em;
    border: 1px solid var(--primary-color-90);
    background-color: var(--primary-color-10);
    transition: background-color 150ms ease-out;
}

.button--active {
    background-color: transparent;
}

.button:hover,
.button:focus {
    background-color: transparent;
}

.button--warning {
    background-color: var(--warning-color-10);
    border-color: var(--warning-color-50);
}

.button--small {
    padding: 0.25em 0.75em;
}

/**
 * Generic flex layout
 */
.flex {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.75em;
}

.flex--justify-center {
    justify-content: center;
}

.flex--justify-evenly {
    justify-content: space-evenly;
}

.flex__item-100 {
    flex: 100% 1 0;
}

.flex__item-95 {
    flex: 95% 1 0;
}

.flex__item-85 {
    flex: 85% 1 0;
}

.flex__item-80 {
    flex: 80% 1 0;
}

.flex__item-75 {
    flex: 75% 1 0;
}

.flex__item-65 {
    flex: 65% 1 0;
}

.flex__item-50 {
    flex: 50% 1 0;
}

.flex__item-35 {
    flex: 35% 1 0;
}

.flex__item-33 {
    flex: 33% 1 0;
}

.flex__item-25 {
    flex: 25% 1 0;
}

.flex__item-20 {
    flex: 20% 1 0;
}

.flex__item-15 {
    flex: 15% 1 0;
}

.flex__item-10 {
    flex: 10% 1 0;
}

.flex__item-5 {
    flex: 5% 1 0;
}

.flex__item--no-grow {
    flex-grow: 0;
}

/**
 * Paginator style
 */
.paginator {
    list-style: none;
    margin: 2em 0;
    padding: 0;
    text-align: center;
    font-size: 1.25rem;
}

.paginator li {
    display: inline-block;
    width: 2em;
}

.paginator a {
    display: block;
    width: 100%;
    height: 100%;
}

/**
 * Generic text classes
 */
.text-left {
    text-align: left;
}

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

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

.text-red {
    color: red;
}

.text-green {
    color: green;
}

.text-bold {
    font-weight: bold;
}

.text-small {
    font-size: 0.75em;
}

.text-big {
    font-size: 1.25em;
}

.par--no-margin {
    margin: 0;
}

.full-underline {
    position: relative;
}

.full-underline::after {
    content: "";
    position: absolute;
    top: calc(1em + 8px);
    left: 0;
    height: 3px;
    width: 100%;
    background-color: black;
}

.full-overline {
    position: relative;
}

.full-overline::before {
    content: "";
    position: absolute;
    top: -0.25em;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: black;
}

/**
 * Generic margin and padding styles
 */
.padding-sides-2em {
    padding: 0 2em;
}

/**
 * Display styles
 */
.display-block {
    display: block;
}

@media (max-width: 60rem) {
    .form {
        max-width: 100%;
    }
}

/**
 * Styles for printing
 */
#printable-invoice {
    margin: 0 auto;
    font-family: "Roboto", sans-serif;
    font-size: 3mm;
}

.printable-page {
    width: 21cm;
    height: 29.7cm;
    padding: 1cm 1cm;
    margin: 0 auto;
    break-after: page;
}

.printable-page h1,
.printable-page h2 {
    margin: 0 0 0.50em 0;
}

.printable-page header {
    margin-bottom: 1.50em;
}

.printable-page header p {
    margin: 0;
}

.invoice-items .table th,
.invoice-items .table td {
    border: 1px solid black;
}

.qr-payment {
    width: 3.5cm;
    height: auto;
}

.invoice-footer {
    margin-top: 4cm;
}

.signature {
    width: 5.5cm;
    margin-left: auto;
    margin-right: 2.5em;
}
