@media (orientation: landscape) {
    body {
        flex-direction: row !important;
    }
}

@media (prefers-color-scheme: dark) {

    .icon, .month-navigator,
    a.back::before, a.forward::before {
        filter: invert(.8);
    }

    .logo {
        filter: brightness(0) saturate(100%) invert(56%) sepia(22%) saturate(4224%) hue-rotate(329deg) brightness(96%) contrast(93%);
        /*filter: invert(0) !important;*/
        /*background: #111;*/
        /*border-radius: 100px;*/
        /*padding: 8px;*/
        /*margin: 8px;*/
    }

    img {
        filter: invert(.8);
    }


    nav > a.active {
        background-color: black !important;
    }

    nav > a.active img {
        /*filter: invert(0);*/
    }

    a:hover img {
        filter: invert(0);
    }

    button img, a.button img {
        filter: invert(0) !important;
    }
}

body {
    background-color: var(--background-color);
    accent-color: var(--accent-primary-color);
}

main {
    flex: 1;
    /*background-color: var(--background-primary);*/
    /*border-radius: 8px;*/
    margin: var(--spacing);
    margin-top: 0;
    /*padding: var(--spacing);*/
}

header .title {
    font-size: 18px;
    letter-spacing: -1px;
}

header .logo {
    height: 32px;
    margin-left: 4px;
}

header > a:first-child {
    height: 32px;
}

nav {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
}


nav > div {
    display: flex;
    align-items: center;
}

nav a {
    text-decoration: none;
    padding: 1rem;
    display: block;
}

header nav a {
    text-align: center;
}

nav a::before {
    display: block;
    content: attr(title);
    font-weight: bold;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}


nav a.active {
    margin-bottom: -7px;
}

nav a.active::after {
    display: block;
    margin: 4px auto 0 auto;
    content: ' ';
    width: 30px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
}

nav a:hover {
    margin-bottom: -7px;
    text-decoration: none;
    color: var(--accent-primary-color);
}

nav a:hover::after {
    display: block;
    margin: 4px auto 0 auto;
    content: '';
    width: 30px;
    height: 3px;
    background-color: var(--accent-primary-color);
    border-radius: 2px;
}

nav a.active:hover {
    /*font-weight: 500;*/
    /*text-decoration: none;*/
}

.nav-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;

    position: relative;
}

.nav-icon img {
    height: 20px;
    width: 20px;
}
.nav-icon.active {
    color: #1F64CC;
    /*margin-bottom: 0;*/
}

.nav-icon::before {
    content: '';
    width: 14px;
}

.nav-icon:hover::after {
    width: 15px;
}
.nav-icon.active::after {
    width: 15px;
}

.nav-icon .count {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 10px;
}

aside > nav {
    flex-direction: column;
}

aside > nav a.active::after {
    margin-left: 4px;
}

aside > nav a:hover::after {
    margin-left: 4px;
}

a {
    color: var(--font-dark);
}

a:hover {
    text-decoration: underline 2px;
}

a.back, a.forward {
    text-decoration: none;
    font-weight: 500;
}

a.back::before, a.forward::before {
    content: " ";
    display: inline-block;
    position: relative;
    background-image: url("/img/icons/chevron-back.svg");
    background-size: 14px;
    width: 18px;
    height: 14px;
    top: 2px;
}
a.forward::before {
    background-image: url("/img/icons/chevron-forward.svg");
}

a.button, button {
    text-decoration: none;
    background-color: var(--accent-primary-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 12px var(--spacing);
    border-radius: 4px;
    cursor: pointer;
}

button.warning {
    background-color: var(--accent-warning-color);
}

button.edit, button.delete {
    padding: 4px 12px;
    float: right;
    background-color: var(--ui-background-color);
    /*border: 1px solid var(--border-color);*/
    color: var(--font-dark);
    border-radius: 999px;
}

a.active {
    font-weight: bold;
}

a.box {
    display: block;
    text-decoration: none;
}

a.box:hover {
    outline: none;
    background-color: var(--grey-4);
}

a.box.active {
    font-weight: bold;
    border-right: 8px solid var(--primary-midnight-blue);
}

a.circle:hover {
    border-radius: 999px;
    outline: 4px #eee solid;

}

a:hover > div {
    background-color: #EEE;
}

/* color */

.bg-teal {
    background-color: #31B7BC;
}


.bg-light-blue {
    background-color: var(--light-blue);
}

.bg-amber {
    background-color: #ED694B;
}

.bg-grey-5 {
    background-color: var(--grey-5);
}


/* icons */

.icon-s {
    width: var(--spacing);
    height: auto;
}

.icon-m {
    width: 24px;
    height: auto;
}

/* borders */

.border-right {
    border-right: 1px solid var(--border-color);
}


.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.border-left {
    border-left: 1px solid var(--border-color);
}

.border-top {
    border-top: 1px solid var(--border-color);
}

/*  */

.pointer {
    cursor: cell;
}

.hyphen {
    hyphens: auto;
}


td, th {
    padding: 8px 12px;
    text-align: left;
}

table {
    min-width: 100%;
    border-spacing: 0;
}

table > tbody > tr:nth-child(odd) {
    background-color: var(--ui-background-color);
}


.ui-tile {
    background-color: var(--ui-background-color);
    border-radius: 4px;
    padding: 8px 12px;
}


aside.htmx-added {
    opacity: 0;
}
aside {
    opacity: 1;
    transition: opacity 1s ease-out;
}

.loading {
    color: var(--border-color);
    background: var(--border-color);
    border-radius: var(--spacing-small);
}

.icon {
    width: 20px;
    height: 20px;
}