
:root {
    --nav-initial-width: 4rem;
    --nav-width: var(--nav-initial-width);
    --svg-size: 1.5rem;
    --text-primary: #08c;
}

html, body {
    font-family: "Open Sans", Arial, sans-serif;
}

body {
    font-size: 14px;
    position: relative;
}

img {
    white-space: normal;
    font-style: italic;
}

body > header > div:last-child {
    background: #111;
}

nav {
    background: #222;
    z-index: 100;
}

.nav-toggle > svg {
    fill: #EEE;
    stroke: #EEE;
}

nav > div ul > li svg {
    width: var(--svg-size);
    height: var(--svg-size);
}

nav > div ul > li > :is(a, button) {
    height: 3rem;
    display: flex;
    align-items: center;
    column-gap: 1rem;
    width: 100%;
}


nav > div ul > li :is(svg, path) {
    fill: #EEE;
    stroke: #EEE;
}

nav > div ul > li a {
    color: #EEE;
}

nav > div ul > li span {
    color: #EEE;
}

nav .parent {
    padding-right: 1rem;
}

nav .parent + ul {
    display: none;
    padding-left: 1rem;
}

.nav .parent[data-href] > svg:last-child {
    width: 1rem;
    height: 1rem;
}

nav > div ul ul > li > :is(a, button) {
    height: 2rem;
}

nav .parent span {
    flex-grow: 1;
    text-align: left;
}
nav .parent .chevron {
    scale: 0.6;
}

nav.groups-loaded .parent .chevron {
    transition: transform 0.1s;
}

nav .parent.open .chevron {
    transform: rotate(180deg);
}

nav .parent.open,
nav .parent.open + ul {
    background: rgba(255, 255, 255, 0.05);
}

body:is(.nav-open, .nav-hover-open) > nav .parent.open + ul {
    display: block;
}

body > main {
    grid-area: main;
    background: #EEE;
    padding: 1rem;
    overflow-x: auto;
}

body > main > div {
    min-width: 100%;
    width: fit-content;
}

:focus, :focus-visible {
    outline: none !important;
}

body > header > div:last-child > h1 {
    font-weight: 600;
    border-bottom: 0.25rem solid #08c;
}

.header-tools svg {
    width: 1rem;
    height: 1rem;
    color: black;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    background: HSL(200, 100%, 40%);
    color: white;
    font-weight: 600;
    border-width: 1px;
    border-style: solid;
    border-color: HSL(200, 100%, 40%);
}

.btn.btn-xs {
	font-size: 11.2px;
	font-size: 0.7rem;
	padding: 3.2px 8px;
	padding: 0.2rem 0.5rem;
}

.btn.btn-sm {
	font-size: 12.8px;
	font-size: 0.8rem;
	padding: 4.8px 10.4px;
	padding: 0.3rem 0.65rem;
}

.btn.btn-lg {
	font-size: 16px;
	font-size: 1rem;
	padding: 8px 16px;
	padding: 0.5rem 1rem;
}

.btn.btn-xl {
	font-size: 16px;
	font-size: 1rem;
	padding: 12.8px 32px;
	padding: 0.8rem 2rem;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary {
    background: #08c;
    border-color: #08C #08C #069;
}

.btn-primary:not(:disabled):hover {
	background-color: #0077B3;
	color: #FFF;
}

.btn.btn-secondary {
	background-color: #CCC;
	border-color: #CCC #CCC #b3b3b3;
	color: #333;
}

.btn.btn-secondary:not(:disabled):hover {
    background: HSL(213.8, 14.8%, 16%);
    color: #EEE;
}

.btn.btn-danger {
	background-color: #d2322d;
	border-color: #d2322d #d2322d #a82824;
	color: #FFF;
}

.btn.btn-danger:not(:disabled):hover {
	background-color: #d9514d;
	border-color: #db5b57 #db5b57 #d2322d;
	color: #FFF;
}

.warning {
    padding: 0.75rem 1rem;
    border: 1px solid hsl(0, 100%, 90%);
    background: hsl(0, 100%, 95%);
    color: #800;
    font-weight: 600;
    border-radius: 0.5rem;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #E05552;
    height: 1rem;
    min-width: 1rem;
    color: white;
    border-radius: 999px;
    padding: 0.10rem 0.25rem;
    font-size: 0.7rem;
    line-height: 0.7rem;
    font-weight: bold;
    text-align: center;
    transform: translate(50%, -25%);
}

/*************************************
 * Loading Spinner
 *************************************/

#ajax-loader {
    display: none;
    position: fixed;
    right: 0;
    bottom: 0;
}

#ajax-loader.active {
    display: block;
}

/*************************************
 * Cart
 *************************************/

.cart-wrap > a {
    position: relative;
    padding: 0.5rem;
    border: 1px solid #DDD;
    border-radius: 999px;
}

.cart-wrap > a > svg {
    width: 1rem;
    height: 1rem;
}


/*************************************
 * Alerts
 *************************************/

.header-tools .alert-toggle-wrap {
    position: relative;
}

.header-tools .alert-toggle {
    position: relative;
    padding: 0.5rem;
    border: 1px solid #DDD;
    border-radius: 999px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

/*
.header-tools .alert-toggle > span {
    position: absolute;
    top: 0;
    right: 0;
    background: #E05552;
    height: 1rem;
    min-width: 1rem;
    color: white;
    border-radius: 999px;
    padding: 0.15rem 0.25rem;
    font-size: 0.7rem;
    line-height: 0.7rem;
    font-weight: bold;
    text-align: center;
    transform: translate(50%, -25%);
}
*/

.header-tools .alert-toggle:hover {
    border: 1px solid #CCC;
}

.header-tools .alert-toggle svg {
    color: #1E90DF;
}

.header-tools .alert-toggle:hover svg {
    color: #4AA0E0;
}

#alerts {
    display: none;
    position: absolute;
    background: white;
    border-radius: 0.2rem;
    overflow: hidden;
}

#alerts.alerts-open {
    display: block;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}

#alerts > .alerts-header {
    padding: 0.7rem 1rem;
    background: #1E90DF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    text-transform: uppercase;
    font-weight: bold;
}

#alerts > .alerts-header > h3 {
    font-size: 0.7rem;
}

.alert-list {
    max-height: 20rem;
    overflow-y: auto;
}

.alert-list li a {
    display: flex;
    flex-direction: column;
    column-gap: 1rem;
    padding: 1rem;
    font-size: 0.9rem;
}

.alert-list li a p:last-child {
    font-size: 0.8rem;
    color: #666;
}

.alert-list li > a:hover {
    background: #F4F4F4;
}

.alert-list li {
    border-bottom: 1px solid #DDD;
}

.alert-list li:last-child {
    border-bottom: none;
}


/*************************************
 * Profile
 *************************************/

.profile-toggle {
    display: flex;
    column-gap: 1rem;
    align-items: center;
    max-width: 100%;
}

.profile-avatar {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #EEE;
}

.profile-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.2rem;
    flex-grow: 1;
    overflow: hidden;
}

.profile-name > * {
    white-space: nowrap;
}

.profile-name > :first-child {
    font-size: 0.8rem;
    line-height: 0.8rem;
}

.profile-name > :last-child {
    font-size: 0.7rem;
    line-height: 0.7rem;
    color: #888;
    padding-bottom: 0.2rem;
}

.profile-toggle.open {
    background: #2A2A2A;
    color: white;
    border: 1px solid #AAA;
}

.profile-chevron {
    margin-left: 0.5rem;
}


.profile-wrap {
    position: relative;
}

.profile-wrap.open {
    /*box-shadow: 0 2px 2px rgba(0, 0, 0, 1); */
    outline: 1px solid #DDD;
}

.profile-wrap .profile-chevron svg {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
}

.profile-wrap.open .profile-chevron svg {
    transform: rotate(180deg);
}

.profile-info {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom-right-radius: 0.4rem;
    overflow: hidden;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}

.profile-info {
    font-size: 0.8rem;
    color: #333;
}

.profile-info svg {
    color: #666;
}

.profile-wrap:not(.open) .profile-info {
    height: 0;
    padding: 0;
    box-shadow: none;
}

.profile-info > ul {
    padding: 0;
    margin: 0;
}

.profile-info > ul > li a {
    display: block;
    padding: 0.5rem 1rem;
    border-top: 1px solid #DDD;
    display: flex;
    align-items: center;
    column-gap: 1rem;
}

.profile-info > ul > li:last-child a {
    border-bottom-left-radius: 0.4rem;
    border-bottom-right-radius: 0.4rem;
}

.profile-info > ul > li:hover > a {
    background: #F4F4F4;
}

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

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

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


/*************************************
 * Table
 *************************************/

.table-wrap {
    display: block;
    width: fit-content;
}

.table {
    border-collapse: collapse;
    text-wrap: nowrap;
}

.table-full {
    width: 100%;
}

.table-striped {
    background: white;
}

.table-striped > tbody > tr:nth-child(odd) {
    background: #F0F0F0;
}

.table tr > *:not(a) {
    padding: 1rem;
    border-bottom: 1px solid #dee2e5;
    text-align: left;
}

.table.slim tr > * {
    padding: 0.5rem;
}

.table tr.nopad > td {
    padding: 0;
}

.table > thead th {
    border-bottom: 2px solid #dee2e5;
}

.table > tbody > tr > th {
    border-right: 2px solid #dee2e5;
}


/*************************************
 * Panel
 *************************************/

/*
.panel-wrap {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
}
*/

.panel {
    position: fixed;
    background: white;
    display: none;
    flex-direction: column;
    border: 1px solid #CCC;
}

.panel > header {
    display: flex;
    align-items: center;
    background: #F0F0F0;
    border-bottom: 1px solid #CCC;
    font-size: 1rem;
}

.panel > header > h4 {
    margin: 0;
    flex-grow: 1;
    padding: 1rem;
}

.panel > header button {
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 999px;
}

.panel > header button:hover {
    background: #DDD;
}

.panel > header > .panel-close > svg {
    color: black;
    width: var(--svg-size);
    height: var(--svg-size);
}

.panel > div {
    padding: 1rem;
    flex-grow: 1;
    overflow: scroll;
}

.panel > footer {
    padding: 1rem;
    font-size: 0.8rem;
    border-top: 1px solid #CCC;
}

#ajax-loader {
    right: 5px;
    bottom: 5px;
    position: fixed;
    display: none;
}

/*************************************
 * Colours
 *************************************/

.status-ApproveOrder, .status-Approved {
    color: rgb(0, 128, 0);
}
.status-RejectOrder, .status-Rejected {
    color: rgb(210, 0, 0);
}
.status-Invoiced, .status-Ordered {
    color: rgb(50, 80, 213);
}
.status-ApprovalRequired {
    color: rgb(239, 165, 28);
}

.session-Online {
    color: rgb(0, 128, 0);
}

/*************************************
 * Misc
 *************************************/

.hidden {
    display: none !important;
}

.underline {
    text-decoration: underline;
}

a, table :is(th, td) a {
    color: var(--text-primary);
    font-weight: 600;
}

