:root {
    --primary: #79aec8;
    --secondary: #417690;
    --accent: #f5dd5d;
    --primary-fg: #fff;

    --body-fg: #333;
    --body-bg: #fff;
    --body-quiet-color: #666;
    --body-loud-color: #000;

    --header-color: #ffc;
    --header-branding-color: var(--accent);
    --header-bg: var(--secondary);
    --header-link-color: var(--primary-fg);

    --breadcrumbs-fg: #c4dce8;
    --breadcrumbs-link-fg: var(--body-bg);
    --breadcrumbs-bg: var(--primary);

    --link-fg: #447e9b;
    --link-hover-color: #036;
    --link-selected-fg: #5b80b2;

    --hairline-color: #e8e8e8;
    --border-color: #ccc;

    --error-fg: #ba2121;

    --message-success-bg: #dfd;
    --message-warning-bg: #ffc;
    --message-error-bg: #ffefef;

    --darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
    --selected-bg: #e4e4e4; /* E.g. selected table cells */
    --selected-row: #ffc;

    --button-fg: #fff;
    --button-bg: var(--primary);
    --button-hover-bg: #609ab6;
    --default-button-bg: var(--secondary);
    --default-button-hover-bg: #205067;
    --close-button-bg: #888; /* Previously #bbb, contrast 1.92 */
    --close-button-hover-bg: #747474;
    --delete-button-bg: #ba2121;
    --delete-button-hover-bg: #a41515;

    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #79aec8;
        --secondary: #417690;
        --accent: #f5dd5d;
        --primary-fg: #fff;

        --body-fg: #333;
        --body-bg: #fff;
        --body-quiet-color: #666;
        --body-loud-color: #000;

        --header-color: #ffc;
        --header-branding-color: var(--accent);
        --header-bg: var(--secondary);
        --header-link-color: var(--primary-fg);

        --breadcrumbs-fg: #c4dce8;
        --breadcrumbs-link-fg: var(--body-bg);
        --breadcrumbs-bg: var(--primary);

        --link-fg: #447e9b;
        --link-hover-color: #036;
        --link-selected-fg: #5b80b2;

        --hairline-color: #e8e8e8;
        --border-color: #ccc;

        --error-fg: #ba2121;

        --message-success-bg: #dfd;
        --message-warning-bg: #ffc;
        --message-error-bg: #ffefef;

        --darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
        --selected-bg: #e4e4e4; /* E.g. selected table cells */
        --selected-row: #ffc;

        --button-fg: #fff;
        --button-bg: var(--primary);
        --button-hover-bg: #609ab6;
        --default-button-bg: var(--secondary);
        --default-button-hover-bg: #205067;
        --close-button-bg: #888; /* Previously #bbb, contrast 1.92 */
        --close-button-hover-bg: #747474;
        --delete-button-bg: #ba2121;
        --delete-button-hover-bg: #a41515;

        --object-tools-fg: var(--button-fg);
        --object-tools-bg: var(--close-button-bg);
        --object-tools-hover-bg: var(--close-button-hover-bg);
    }
}

#content {
    padding: 0;
    margin: 15px;
}

#header {
    background: #16162c;

    /* Reset the indents of django-flat-theme
      (need to restore 40px on branding+user-tools instead) */
    padding-left: 0;
    padding-right: 0;
}

#header #branding h1 {
    margin: 0;
    padding: 5px 5px;
    text-indent: -9999px;
    height: 28px;
    width: 200px;
    background: transparent url(logo.png) no-repeat center center / contain;
}

#header #user-tools {
    /* Old Django: 1.2em, flat theme: 40px; */
    padding-right: 1.2em;
}

div.breadcrumbs {
    display: block;
    padding: 10px 15px;
    border: 0;
    background-position: 0 -8px;
    border-bottom: 1px solid #ededed;
}

div.breadcrumbs a {
    display: inline;
}

.col33 {
    display: block;
    width: 33%;
    float: right;
    height: 100%;
    vertical-align: top;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    padding: 0 0 0 5px;
    margin: 0;
}

.col50 {
    display: block;
    width: 50%;
    float: right;
    height: 100%;
    vertical-align: top;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    padding: 0 0 0 5px;
    margin: 0;
}

/* ADMIN TOOLS */

@media (prefers-color-scheme: dark) {
    .dashboard #content {
        display: block;
        width: auto; !important;
        margin: 15px 5px;
    }

    .dashboard-container {
        clear: both;
    }

    h1.dashboard-title {
        float: left;
        padding-bottom: 0;
        margin: 0 10px;
    }

    #dashboard-panel {
        margin: 0 10px 0 0;
        float: right;
    }

    #dashboard-panel h3 a {
        padding: 5px;
        min-width: 100px;
        display: block;
        text-align: center;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
    }

    #dashboard-panel ul {
        display: none;
        position: absolute;
        top: auto;
        right: 25px;
        margin-top: -1px;
    }

    #dashboard-panel ul li {
        padding: 5px;
        border: 1px solid #e5e5e5;
        background-color: white;
    }

    #dashboard-panel ul li a {
        display: block;
    }

    #dashboard-panel:hover ul {
        display: block;
    }

    .dashboard ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .dashboard ul li {
        list-style: none;
    }

    .dashboard-column {
        width: 49.9%;
        float: left;
        min-height: 200px;
    }

    .dashboard-module {
        margin: 10px 10px 5px 10px;
        padding: 0;
        border: 1px solid #e5e5e5;
        -moz-border-radius: 6px;
        -webkit-border-radius: 6px;
    }

    .dashboard-placeholder {
        border: 2px dashed #cbe0ff;
        background-color: #f8f8f8;
        margin: 10px 10px 5px 10px;
    }

    .dashboard-module h2 {
        margin: 0;
        padding: 7px 5px 8px 8px;
        text-align: left;
        font-weight: normal;
        background: #f8f8f8;
        height: 20px;
        color: #555;
    }

    .dashboard-module.draggable h2 {
        cursor: move;
    }

    .dashboard-module h2 a.toggle-icon,
    .dashboard-module h2 a.close-icon {
        text-indent: -9999px;
        display: block;
        float: right;
        height: 20px;
        width: 17px;
        margin: 0 0 0 5px;
        cursor: pointer;
        background-image: url(../images/admin-tools.png);
        background-repeat: no-repeat;
        transition: none !important;
    }

    .dashboard-module h2 a.toggle-icon {
        background-position: 0 -45px;
    }

    .dashboard-module h2 a.toggle-icon:hover {
        background-position: 0 -65px;
    }

    .dashboard-module h2 a.toggle-icon.collapsed {
        background-position: 0 -85px;
    }

    .dashboard-module h2 a.toggle-icon.collapsed:hover {
        background-position: 0 -105px;
    }

    .dashboard-module h2 a.close-icon {
        background-position: 0 -125px;
    }

    .dashboard-module h2 a.close-icon:hover {
        background-position: 0 -145px;
    }

    .fixed h2 span.toggle-icon,
    .fixed h2 span.close-icon {
        display: none;
    }

    .dashboard-module h3 {
        padding: 5px 8px;
        margin: 0;
        background: #fafafa;
        height: 22px;
    }

    .dashboard-module h3 a {
        margin: 0;
        color: #666;
        font-size: 13px;
        font-weight: normal;
    }

    .dashboard-module-content {
        border-top: 1px solid #ececec;
    }

    .dashboard-module-content a {
        color: #5B80B2;
    }

    .dashboard-module-content p {
        margin: 10px;
    }

    .dashboard-module ul li {
        vertical-align: top;
        padding: 5px 8px;
        line-height: 20px;
    }

    .dashboard-module ul li.odd {
        background: #f5f5f5;
    }

    .dashboard-module ul li.even {
        background: #ffffff;
    }

    .dashboard-module ul li a.external-link {
        background-image: url(../images/admin-tools.png);
        background-repeat: no-repeat;
        background-position: -5px -168px;
        padding-left: 15px;
    }

    .dashboard-module ul li ul {
        float: right;
    }

    .dashboard-module ul li ul li {
        display: block;
        float: left;
        border: 0;
        padding: 0 5px;
        vertical-align: top;
        height: auto;
        line-height: auto;
    }

    .dashboard-module ul li:hover {
        background: #fffff4;
    }

    /* }}} */
    /* link list specific styles {{{ */


    .dashboard-module ul.inline {
        display: block;
        height: auto;
        padding: 15px;
        text-align: center;
    }

    .dashboard-module ul.inline li {
        display: inline;
        margin: 10px auto;
    }

    .dashboard-module ul.inline li.odd,
    .dashboard-module ul.inline li.even {
        background: none;
    }

    /* }}} */
    /* Dashboard groups {{{ */

    .group {
        border: 0;
        margin: 0;
        padding: 0;
    }

    .group ul {
        background: none;
        background-color: #fafafa;
        border-width: 0 0 1px 0;
        border-color: #d3d3d3;
        border-radius: 0;
    }

    .group ul li.group-tabs-link {
        margin-top: 7px;
    }

    .group ul li.group-tabs-link a:focus,
    .group ul li.group-tabs-link a:active {
        border: none;
        outline: none;
    }

    .group .dashboard-module {
        padding: 5px;
        margin: 0;
    }

    .group-accordion .group-accordion-header {
        display: block;
        clear: both;
        border: none;
        -moz-border-radius: 0;
        -webkit-border-radius: 0;
        border-radius: 0;
        border-bottom: 1px solid #d3d3d3;
        margin: 0;
        background: none;
        background-color: #f6f6f6;
    }

    .group-accordion .group-accordion-header.ui-state-default {
        background-color: #f0f0f0;
    }

    .group-accordion .dashboard-module {
        border: 0;
    }

    .dashboard-module.ui-tabs-panel,
    .group .ui-state-default,
    .group-accordion .group-accordion-header.ui-state-default,
    #dashboard-panel ul li,
    .dashboard-module ul li {
        background: #fff;
    }
}