/* basic */

:root {
  accent-color: #0088ee;
}

body {
  background-color: #f4f4f4;
  color: #333333;
  font-size: 0.875rem; /* 14px / 16px */
  line-height: 1.4;
}

a:not(:hover) {
  text-decoration: none;
}


/* layout */

:root {
  --inner-gutter: 16px;
  --layout-gutter: 16px;
}

@media (min-width: 36rem) { /* 576px / 16px */

  :root {
    --layout-gutter: 32px;
  }

}

.page-layout {
  display: grid;
  grid-template:
    "header" auto
    "nav"    auto
    "body"   1fr
    "footer" auto;
  height: 100vh;
}

.page-header {
  grid-area: header;
}

.page-header-nav {
  grid-area: nav;
}

.page-body {
  grid-area: body;
}

.page-footer {
  border-bottom: #cc0000 solid 3px;
  grid-area: footer;
}

@media (min-width: 1080px) {

  .container {
    --layout-width: 1080px;
    max-width: var(--layout-width);
    width: var(--layout-width);
  }

}

.page-body-inner {
  padding: var(--layout-gutter);
}

.notifications {
  margin-bottom: var(--layout-gutter);
}

.box {
  background-color: #ffffff;
  border-color: #cccccc;
  border-radius: 3px;
  border-style: solid;
  border-width: 1px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.box {
  display: block;
  padding: 20px;
}

.box + .box {
  margin-top: var(--inner-gutter);
}

a.box {
  color: inherit;
  text-decoration: none;
}

a.box:hover {
  background-color: #f4f4f4;
  border-color: #bbbbbb;
}

.box--marked {
  border-left: var(--box-marker-color, #cccccc) solid 0.25rem !important;
}

.box--marked.color-danger {
  --box-marker-color: var(--color-danger);
}

.box--marked.color-disabled {
  --box-marker-color: var(--color-disabled);
}

.box--marked.color-info {
  --box-marker-color: var(--color-info);
}

.box--marked.color-success {
  --box-marker-color: var(--color-success);
}

.box--marked.color-warning {
  --box-marker-color: var(--color-warning);
}


/* header */

#header {
  background-color: #555555;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#header-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  min-height: 48px;
  justify-content: space-between;
  padding: 4px var(--layout-gutter);
}

#header-content .column {
  align-self: center;
}

#header-content .column--brand,
#header-content .column--user {
  flex: 0 0 auto;
}

#header-content .column--form {
  flex: 1 0 auto;
}

#header-content .brand-icon {
  display: inline-block;
  fill: #e4c444;
  margin-right: -0.5rem;
  margin-top: 0.5rem;
  width: 0.75rem;
}

#header-content .brand-text {
  color: #eeeeee;
  font-size: 1.75rem; /* 28px / 16px */
}

#header-content .current-user .button,
#header-content .current-user .button:hover,
#header-content .current-user .dropdown-toggle {
  background-color: transparent;
  color: #eeeeee;
  display: block;
  font-size: 0.875rem; /* 14px / 16px */
}

#header-content .current-user .dropdown-toggle {
  padding: 0;
}

#header-content .current-user .avatar {
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.1);
}

#header-content .label-and-name .label {
  display: block;
  font-size: 0.6875rem; /* 11px / 16px */
  margin-bottom: 0.25rem;
  opacity: 0.5;
}

#header-content .label-and-name .name {
  color: currentColor;
  display: block;
  font-size: 1.0625rem; /* 17px / 16px */
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
}

#header-content form button,
#header-content form input {
  border: none;
  border-radius: 7px;
  color: #444444;
}

#header-content form {
  margin: 0 auto;
  max-width: 22rem;
}

#header-content form input {
  background-color: #888888;
  padding: 0.4rem 2.6rem 0.4rem 0.4rem;
  width: 100%;
}

#header-content form button {
  background-color: transparent;
  margin-left: -2.65rem;
}

#header-content form button:hover,
#header-content form input:hover {
  background-color: #eeeeee;
}

#header-content form input:not(:placeholder-shown) {
  background-color: #eeeeee;
}


/* header navigation */

.page-header-nav {
  background-color: #ffffff;
  border-bottom: #dddddd solid 1px;
  border-top: #aaaaaa solid 1px;
}

.header-nav {
  padding: 0 var(--layout-gutter);
}

.header-nav-crumbs {
  align-items: stretch;
  display: flex;
}

.header-nav-crumb {
  --border-width: 0.125rem;
  align-items: center;
  border-color: transparent;
  border-style: solid;
  border-width: var(--border-width) 0 0 0;
  color: #666666;
  display: flex;
  gap: 0 0.5rem;
  padding: 0.75rem 0 0.5rem 0;
  text-decoration: none;
}

.header-nav-crumb:hover {
  border-color: #aaaaaa;
}

.header-nav-crumb-meta {
  color: var(--dimmed-color);
  font-size: 0.8125rem; /* 13px / 16px */
}

.header-nav-crumb-separator {
  align-self: center;
  display: flex;
}

.header-nav-crumb-separator::before {
  color: #aaaaaa;
  content: "›";
  padding: 0 0.75rem;
}

.header-nav .main-tabs ol {
  border: 0;
  margin: 0;
}


/* tabs above main content area */

.main-tabs ol {
  border-bottom: #cccccc solid 1px;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-tab {
  --border-width: 0.125rem;
  border-color: transparent;
  border-style: solid;
  border-width: 0 0 0 var(--border-width);
  color: #333333;
  display: block;
  font-size: 0.75rem; /* 12px / 16px */
  height: 100%;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  user-select: none;
}

.main-tab:hover {
  border-color: #aaaaaa;
}

.main-tab--current {
  border-color: #1199ff;
}

.main-tab .row {
  column-gap: 0.2rem;
}

.main-tab .icon {
  color: #aaaaaa;
  margin-right: 0.2rem;
}

.main-tab--current .icon {
  color: #5c5c5c;
}

@media (min-width: 48rem) { /* 768px / 16px */

  .main-tabs ol {
    flex-direction: row;
  }

  .main-tab {
    border-width: 0 0 var(--border-width) 0;
  }

}


/* tabs (adjustment of common tabs) */

.tabs-tab {
  border-width: 0 0 0.125rem 0;
  color: #666666;
  font-size: 0.75rem; /* 12px / 16px */
  margin-right: 0.125rem;
  padding: 0.5rem 0.75rem;
}

.tabs-tab:hover,
.tabs-tab--current {
  background-color: transparent;
  color: currentColor;
}

.tabs-tab:hover {
  border-color: #aaaaaa;
}

.tabs-tab--current {
  border-color: #1199ff;
}


/* headings */

h1 {
  font-size: 1.75rem; /* 28px / 16px */
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem; /* 20px / 16px */
  margin-top: 2rem;
}

h1 small,
h2 small {
  font-weight: normal;
  opacity: 0.5;
}

h1 small {
  font-size: 1.5rem; /* 24px / 16px */
}

h2 small {
  font-size: 1.125rem; /* 18px / 16px */
}


/* tables */

@media (max-width: 1080px) {

  table.index--wide {
    display: block;
    overflow-x: auto;
  }

}


/* layouts */

.grid {
  --column-min-width: 220px;
  display: grid;
  gap: var(--inner-gutter);
  grid-template-columns: repeat(auto-fill, minmax(var(--column-min-width), 1fr));
}


/* lists */

ol.index,
ol.index li {
  border-color: #cccccc;
  border-style: solid;
}

ol.index {
  border-width: 0 0 1px 0;
}

ol.index li {
  border-width: 1px 0 0 0;
  font-size: 0.875rem; /* 14px / 16px */
  padding: 0.35rem 0;
}

ol.index.fully-linked li {
  padding: 0;
}

ol.index.fully-linked a {
  color: currentColor;
  display: block;
  margin: 0 -40px;
  padding: 0.35rem 40px;
  text-decoration: none;
}

ol.index.fully-linked a:hover {
  background-color: #f8f888;
}

.list-grid {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: -8px 0 0 -8px;
  padding: 0;
}

.list-grid > li {
  padding: 8px 0 0 8px;
}

ul.compact {
  margin: 0;
  padding: 0 0 0 1rem;
}


/* tags */

.tag.order-open {
  background-color: var(--color-warning) !important;
}

.tag.order-canceled-before-paid {
  background-color: #999999 !important;
}

.tag.order-paid {
  background-color: #11aa22 !important;
}

.tag.order-canceled-after-paid {
  background-color: #666666 !important;
}

.tag.order-waiting-for-shipping {
  background-color: var(--color-info) !important;
}

h1 .tag {
  font-size: 0.75rem !important; /* 12px / 16px */
  padding: 0.4rem 0.6rem;
  vertical-align: 0.4rem;
}

h1 .tag .icon {
  margin-right: 0.125rem;
}


/* buttons */

.button.color-primary {
  background-color: #555555;
  border-width: 0;
  color: #f8f8f8;
  font-weight: normal;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.button.color-primary:hover {
  background-color: #666666;
}


/* dropdowns */

.page-body-inner .dropdown-menu {
  border-radius: 3px;
  top: calc(100% - 1px);
}

.dropdown-menu {
  padding: 0.25rem 0;
}

.dropdown-item,
.dropdown-label {
  border-radius: 0.25rem;
  margin: 0.25rem 0.5rem;
  padding: 0.25rem 0.5rem;
}

.dropdown-item:hover {
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}


/* filters */

.filter {
  font-size: 0.75rem; /* 12px / 16px */
  white-space: nowrap;
}

.filter .tag.color-none {
  background-color: #ffffff;
  border: #cccccc solid 1px;
  color: #666666;
  text-shadow: none;
}


/* stats */

.bigstats figure {
  text-align: center;
}

.bigstats .value {
  font-size: 2.5rem; /* 40px / 16px */
  font-weight: bold;
  line-height: 1;
}

.bigstats a {
  color: currentColor;
}


/* footer */

#footer {
  display: block;
  font-size: 0.6875rem; /* 11px / 16px */
  line-height: 1.7;
  margin-bottom: 40px;
  opacity: 0.5;
  text-align: center;
}

#footer:hover {
  opacity: 1;
}

#footer:not(:hover) a {
  color: currentColor;
}


/* users */

.user-microcard {
  display: flex;
}

.user-microcard-avatar {
  height: 2.5rem;
  margin-right: 0.4rem;
  width: 2.5rem;
}

.user-microcard--tiny-avatar .user-microcard-avatar {
  height: 1rem;
  width: 1rem;
}

.user-microcard-names {
  display: flex;
  flex-direction: column;
  font-size: 0.8125rem; /* 13px / 16px */
  justify-content: space-around;
  white-space: nowrap;
}

.user-microcard-screen-name {
  font-weight: bold;
}


/* events */

.events {
  --path-color: #eeeeee;
  --path-width: 0.125rem;
  --icon-container-border-width: var(--path-width);
  --icon-container-size: 2rem;
  --icon-size: 1rem;

  --half-path-width: calc(var(--path-width) / 2);
  --half-icon-container-width: calc(var(--icon-container-size) / 2);
  --path-gradient-color-stop-1: calc(var(--half-icon-container-width) - var(--half-path-width));
  --path-gradient-color-stop-2: calc(var(--half-icon-container-width) + var(--half-path-width));

  background: linear-gradient(90deg,
    transparent var(--path-gradient-color-stop-1),
    var(--path-color) var(--path-gradient-color-stop-1),
    var(--path-color) var(--path-gradient-color-stop-2),
    transparent var(--path-gradient-color-stop-2)
  );
}


.event {
  display: flex;
  padding: 0.25rem 0;
}

.event-icon {
  align-items: center;
  background-color: var(--path-color);
  border: #ffffff solid var(--icon-container-border-width);
  border-radius: 50%;
  display: flex;
  flex: 0 0 auto;
  height: var(--icon-container-size);
  justify-content: center;
  width: var(--icon-container-size);
}

.event-icon .icon {
  fill: #666666;
  height: var(--icon-size);
  width: var(--icon-size);
}

.event-data {
  color: var(--dimmed-color);
  flex: 1 1 auto;
  margin-left: 1rem;
  margin-top: 0.25rem;
}

.event-body {
  font-size: 0.8125rem; /* 13px / 16px */
}

.event-timestamp {
  font-size: 0.6875rem; /* 11px / 16px */
  margin-top: 0.5rem;
  text-align: right;
  white-space: nowrap;
}

.event-body .user-link a {
  color: currentColor;
  font-weight: bold;
}

.event-body .user-link a:not(:hover) {
  text-decoration: none;
}

.event-body blockquote {
  background-color: #f4f4f4;
  border-radius: 0.5rem;
  padding: 1rem;
  white-space: pre-wrap;
}


/* misc */

.mb {
  margin-bottom: var(--inner-gutter);
}

.mt {
  margin-top: var(--inner-gutter);
}

.column--align-bottom {
  align-self: flex-end;
}

.dimmed-box {
  border-radius: 3px;
  border: #dddddd solid 1px;
  color: var(--dimmed-color);
  padding: 1.5rem;
}

.preview-background {
  background-image: repeating-linear-gradient(
    135deg,
    transparent, transparent 8px,
    #fff8f4 8px, #fff8f4 16px
  );
}


/* print view */

@media print {

  * {
    background-color: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .main-tabs,
  .page-footer,
  .page-header,
  .page-header-nav {
    display: none;
  }

  .page-body-grid {
    display: block;
  }

  .box {
    border: none;
  }

  table {
    display: table !important;
    overflow: visible !important;
  }

  .button-row {
    display: none !important;
  }

}
