/*
 * Control Center page theme: restyles Bootstrap 3 and the Kendo UI 2015
 * "bootstrap" skin in the Icelandair / Áróra look, in light and dark.
 * Colours come from cc-tokens.css; link this file after every library stylesheet.
 */

/* ---------- base ---------------------------------------------------------- */

html {
  background: var(--cc-bg);
}
html,
body {
  font-family: var(--cc-font);
  color: var(--cc-text);
}
body {
  background: var(--cc-bg);
  padding: 20px 28px 0;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* magicmix.css sets every h1/h2/h3/p to 16px Roboto Slab; undo that */
h1, h2, h3, h4, p, label, .linkHdr {
  font-family: var(--cc-font);
}
h1, h2, h3, h4 {
  color: var(--cc-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p {
  font-size: 14px;
  font-weight: 400;
}
a {
  color: var(--cc-link);
}
a:hover,
a:focus {
  color: var(--cc-link);
}
strong, b {
  font-weight: 700;
}
::selection {
  background: var(--cc-row-selected);
}
.text-muted {
  color: var(--cc-muted);
}

/* ---------- page header ------------------------------------------------- */

.cc-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--cc-border);
}
.cc-page-header h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}
.cc-page-header .cc-lede {
  margin: 6px 0 0;
  color: var(--cc-muted);
  font-size: 14px;
}
.cc-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cc-link);
}
.cc-eyebrow:empty {
  display: none;
}

/* section tabs under a page header (site's top nav: thick bar under the active item) */
.cc-page-header--tabs {
  border-bottom: 0;
  margin-bottom: 4px;
}
.cc-tabs {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--cc-border);
}
.cc-tabs a {
  position: relative;
  padding: 8px 0 12px;
  color: var(--cc-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.cc-tabs a:hover {
  color: var(--cc-link);
  text-decoration: none;
}
.cc-tabs a.active {
  font-weight: 700;
}
.cc-tabs a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  background: var(--cc-ink);
}

/* filter / action rows above grids (the grey band of the site's forms) */
.cc-toolbar {
  display: flex;
  gap: 10px 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--cc-band);
  border-radius: var(--cc-radius);
}
.cc-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  font-size: 13px;
  color: var(--cc-muted);
}
.cc-toolbar .cc-toolbar-sep {
  width: 1px;
  align-self: stretch;
  background: var(--cc-border);
}
/* checkbox shown as a switch, like the Lights toggle and the Settings switches */
.cc-toolbar .cc-check {
  margin-left: auto;
}
.cc-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.cc-toolbar label.cc-check {
  color: var(--cc-ink);
  font-weight: 600;
}
.cc-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--cc-border-strong);
  border-radius: 11px;
  background: var(--cc-surface);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.cc-check input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cc-border-strong);
  transition: left 140ms ease, background 140ms ease;
}
.cc-check input[type="checkbox"]:checked {
  background: var(--cc-primary);
  border-color: var(--cc-primary);
}
.cc-check input[type="checkbox"]:checked::before {
  left: 18px;
  background: var(--cc-on-primary);
}
.cc-check input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--cc-focus-ring);
}
@media (prefers-reduced-motion: reduce) {
  .cc-check input[type="checkbox"],
  .cc-check input[type="checkbox"]::before { transition: none; }
}
input[type="checkbox"] {
  accent-color: var(--cc-primary);
}

/* ---------- buttons -------------------------------------------------- */

.k-button,
.btn {
  font-family: var(--cc-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  padding: 7px 14px;
  border-radius: var(--cc-radius);
  border: 1px solid var(--cc-border-strong);
  background: var(--cc-surface);
  background-image: none;
  color: var(--cc-ink);
  box-shadow: none;
  text-shadow: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.k-button:hover,
.k-button.k-state-hover,
.btn-default:hover,
.btn-default:focus {
  background: var(--cc-tint);
  background-image: none;
  border-color: var(--cc-border-strong);
  color: var(--cc-ink);
}
.k-button:focus,
.k-button.k-state-focused,
.btn:focus {
  outline: none;
  box-shadow: var(--cc-focus-ring);
}
.k-button:active,
.k-button.k-state-active {
  background: var(--cc-row-selected);
  color: var(--cc-ink);
  box-shadow: none;
}
/* primary: navy filled ("Subscribe") */
.k-button.k-primary,
.btn-primary {
  background: var(--cc-primary);
  border-color: var(--cc-primary);
  color: var(--cc-on-primary);
}
.k-button.k-primary:hover,
.k-button.k-primary.k-state-hover,
.btn-primary:hover,
.btn-primary:focus {
  background: var(--cc-primary-hover);
  border-color: var(--cc-primary-hover);
  color: var(--cc-on-primary);
}
/* call to action: green ("Search"), used for "Add new record" */
.k-grid-toolbar .k-grid-add,
.k-button.cc-cta {
  background: var(--cc-cta);
  border-color: var(--cc-cta);
  color: var(--cc-on-cta);
}
.k-grid-toolbar .k-grid-add:hover,
.k-button.cc-cta:hover {
  background: var(--cc-cta-hover);
  border-color: var(--cc-cta-hover);
  color: var(--cc-on-cta);
}
.k-button .glyphicon {
  font-size: 11px;
  top: 1px;
  margin-right: 5px;
}
.k-button[disabled],
.k-button.k-state-disabled {
  opacity: 0.5;
}
/* row command buttons stay compact */
.k-grid td .k-button {
  padding: 4px 10px;
  font-size: 12px;
}
.k-grid td .k-button.k-grid-delete:hover {
  border-color: var(--cc-danger);
  color: var(--cc-danger);
  background: var(--cc-surface);
}
.btn-group .k-button + .k-button {
  margin-left: -1px;
}

/* ---------- form fields ------------------------------------------------- */

.k-textbox,
.form-control,
input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="password"],
textarea,
select {
  font-family: var(--cc-font);
  font-size: 13px;
  color: var(--cc-text);
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: none;
}
.k-textbox:focus,
.k-textbox.k-state-focused,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cc-link);
  box-shadow: var(--cc-focus-ring);
}
/* One 32px field height. Size the inner input, not the wrapper: a taller wrapper
   leaves Kendo's 26px input (and its text) stuck to the top. */
.k-dropdown-wrap .k-input,
.k-picker-wrap .k-input,
.k-numeric-wrap .k-input,
.k-autocomplete .k-input {
  height: 30px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 10px;
  box-sizing: border-box;
}
.k-dropdown-wrap .k-select,
.k-picker-wrap .k-select,
.k-numeric-wrap .k-select {
  height: 30px;
  line-height: 30px;
}
.k-dropdown-wrap .k-select .k-icon,
.k-picker-wrap .k-select .k-icon {
  vertical-align: middle;
}
input.k-textbox {
  height: 32px;
  padding: 0 10px;
  box-sizing: border-box;
}
.k-autocomplete.k-state-default,
.k-dropdown-wrap.k-state-default,
.k-numeric-wrap.k-state-default,
.k-picker-wrap.k-state-default,
.k-multiselect-wrap {
  background: var(--cc-surface);
  background-image: none;
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  color: var(--cc-text);
}
.k-dropdown-wrap.k-state-hover,
.k-picker-wrap.k-state-hover,
.k-numeric-wrap.k-state-hover {
  background: var(--cc-surface);
  background-image: none;
  border-color: var(--cc-muted);
}
.k-dropdown-wrap.k-state-focused,
.k-picker-wrap.k-state-focused,
.k-numeric-wrap.k-state-focused,
.k-autocomplete.k-state-focused {
  background: var(--cc-surface);
  border-color: var(--cc-link);
  box-shadow: var(--cc-focus-ring);
}
.k-input,
.k-dropdown-wrap .k-input,
.k-picker-wrap .k-input,
.k-numeric-wrap .k-input {
  color: var(--cc-text);
  background: transparent;
  font-family: var(--cc-font);
}
/* inner inputs of Kendo widgets: the wrapper draws the box and focus ring */
input.k-input,
input.k-input:focus,
.k-widget input.k-input:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.k-dropdown-wrap .k-select,
.k-picker-wrap .k-select,
.k-numeric-wrap .k-select {
  border: 0;
  background: transparent;
}
::placeholder {
  color: var(--cc-muted);
  opacity: 1;
}

/* ---------- grid ------------------------------------------------------ */

.k-widget,
.k-grid,
.k-grid-header,
.k-grid-header-wrap,
.k-grid-content,
.k-grid-content-locked,
.k-grid-header-locked,
.k-grid-footer,
.k-grid-footer-wrap,
.k-content {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
}
.k-grid {
  font-family: var(--cc-font);
  font-size: 13px;
  border-radius: var(--cc-radius);
  box-shadow: none;
}
/* column headers: uppercase navy (site's DATE / FLIGHTS / STATUS) */
.k-grid-header th.k-header,
.k-grid-header .k-header,
.k-grid .k-header {
  background: var(--cc-surface);
  background-image: none;
  border-color: var(--cc-border);
  color: var(--cc-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 10px;
  padding-bottom: 10px;
}
.k-grid-header th.k-header > .k-link,
.k-grid .k-header .k-link {
  color: var(--cc-ink);
}
.k-grid-header {
  border-bottom: 2px solid var(--cc-border);
}
.k-grid td {
  border-color: var(--cc-border);
  padding-top: 8px;
  padding-bottom: 8px;
}
.k-grid tr.k-alt,
.k-grid .k-alt {
  background: var(--cc-surface-2);
}
.k-grid tbody tr:hover,
.k-grid tbody tr.k-state-hover {
  background: var(--cc-row-hover);
  background-image: none;
}
.k-grid tr.k-state-selected,
.k-grid td.k-state-selected,
.k-state-selected {
  background: var(--cc-row-selected);
  background-image: none;
  color: var(--cc-text);
  border-color: var(--cc-border);
}
.k-grid td.k-state-focused,
.k-grid th.k-state-focused {
  box-shadow: inset 0 0 0 2px var(--cc-link);
}
.k-grid .k-dirty {
  border-color: var(--cc-accent) transparent transparent var(--cc-accent);
}
/* in-cell edit (double-click, scripts/grid_incell_edit.js): Kendo marks the open
   cell td.k-edit-cell and its row tr.k-grid-edit-row. Frame the cell, keep the row
   selected-blue and hang a tag under the cell saying how to save or cancel. */
.k-grid tbody tr.k-grid-edit-row,
.k-grid tbody tr.k-grid-edit-row:hover {
  background: var(--cc-row-selected);
}
.k-grid td.k-edit-cell {
  position: relative;
  overflow: visible; /* Kendo clips cells; the tag hangs outside */
  padding: 4px 6px;
  background: var(--cc-surface);
  box-shadow: inset 0 0 0 2px var(--cc-link);
}
.k-grid td.k-edit-cell[data-edit-hint]::after {
  content: attr(data-edit-hint);
  position: absolute;
  z-index: 3;
  top: 100%;
  left: 0;
  padding: 3px 8px;
  border-radius: 0 0 var(--cc-radius-lg) var(--cc-radius-lg);
  background: var(--cc-link);
  color: var(--cc-on-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
/* bottom row of the scroll area: the script flips the tag above the cell */
.k-grid td.k-edit-cell.cc-hint-above::after {
  top: auto;
  bottom: 100%;
  border-radius: var(--cc-radius-lg) var(--cc-radius-lg) 0 0;
}
/* the editor fills the cell and looks like a field. input.k-input loses its
   border above (meant for inputs inside Kendo widgets), and magicmix.css makes
   every dropdown 250px wide. */
.k-grid td.k-edit-cell > .k-textbox,
.k-grid td.k-edit-cell > .k-widget,
.k-grid td.k-edit-cell > textarea {
  width: 100%;
}
.k-grid td.k-edit-cell > input.k-textbox,
.k-grid td.k-edit-cell > input.k-textbox:hover {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--cc-border-strong);
  background: var(--cc-surface);
  color: var(--cc-text); /* Kendo's :hover sets #333, unreadable in dark */
}
.k-grid td.k-edit-cell > input.k-textbox:focus {
  border-color: var(--cc-link);
}
/* Kendo 2015 gives dropdowns a k-header class; keep the column-header look off */
.k-grid td.k-edit-cell .k-dropdown.k-header {
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.k-grid-toolbar {
  background: transparent;
  border-color: var(--cc-border);
  padding: 10px 8px;
}
.k-grid-toolbar .k-button + .k-button {
  margin-left: 6px;
}
.k-grouping-header {
  background: var(--cc-band);
  color: var(--cc-muted);
  border-color: var(--cc-border);
  font-size: 12px;
}
.k-grouping-header .k-group-indicator {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  color: var(--cc-ink);
}
.k-grouping-row td,
.k-group-cell,
.k-grouping-row .k-reset {
  background: var(--cc-tint);
  color: var(--cc-ink);
  font-weight: 600;
}
.k-pager-wrap {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-muted);
}
.k-pager-numbers .k-state-selected {
  background: var(--cc-primary);
  color: var(--cc-on-primary);
  border-radius: var(--cc-radius);
}
.k-pager-wrap .k-link {
  color: var(--cc-ink);
  border-radius: var(--cc-radius);
}
.k-pager-wrap .k-link:hover {
  background: var(--cc-tint);
}
.k-pager-wrap .k-link,
.k-pager-wrap .k-pager-refresh,
.k-pager-wrap .k-pager-nav {
  background: var(--cc-surface);
  border-color: var(--cc-border);
}
.k-pager-wrap .k-link.k-state-disabled {
  background: transparent;
  opacity: 0.45;
}
.k-grid-norecords,
.k-grid .k-grid-content-expander {
  color: var(--cc-muted);
}

/* ---------- popups, lists and menus ------------------------------------- */

.k-popup,
.k-list-container,
.k-animation-container .k-popup,
.k-menu .k-menu-group,
.k-context-menu,
.k-filter-menu,
.k-column-menu,
.k-calendar,
.k-calendar-container {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
  box-shadow: var(--cc-shadow-pop);
  border-radius: var(--cc-radius);
}
.k-list .k-item,
.k-popup .k-list .k-item,
.k-menu .k-item > .k-link {
  color: var(--cc-text);
  border-radius: 0;
}
.k-list .k-item.k-state-hover,
.k-popup .k-list .k-item.k-state-hover,
.k-list .k-item.k-state-focused,
.k-menu .k-item.k-state-hover > .k-link,
.k-menu .k-item > .k-link:hover {
  background: var(--cc-row-hover);
  background-image: none;
  color: var(--cc-ink);
  box-shadow: none;
}
.k-list .k-item.k-state-selected,
.k-popup .k-list .k-item.k-state-selected {
  background: var(--cc-primary);
  color: var(--cc-on-primary);
}
.k-menu.k-context-menu {
  padding: 4px 0;
}
.k-calendar .k-header,
.k-calendar th {
  background: var(--cc-surface);
  color: var(--cc-ink);
}
.k-calendar td.k-state-selected .k-link {
  background: var(--cc-primary);
  color: var(--cc-on-primary);
}
.k-calendar .k-link {
  color: var(--cc-text);
}

/* ---------- windows (edit popups, dialogs) -------------------------------- */

.k-window {
  background: var(--cc-surface);
  border: 0;
  border-radius: var(--cc-radius-lg);
  box-shadow: var(--cc-shadow-pop);
  color: var(--cc-text);
}
.k-window-titlebar,
.k-window-titlebar.k-header {
  background: var(--cc-surface);
  background-image: none;
  border-bottom: 1px solid var(--cc-border);
  color: var(--cc-ink);
  font-family: var(--cc-font);
  font-size: 16px;
  font-weight: 700;
  padding-top: 10px;
  padding-bottom: 10px;
}
.k-window-titlebar .k-window-title {
  top: 10px;
}
/* the site's accent bar before section titles */
.k-window-titlebar .k-window-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 10px;
  vertical-align: -2px;
  background: var(--cc-cta);
}
.k-window-content {
  background: var(--cc-surface);
  color: var(--cc-text);
}
.k-overlay {
  background: #000a1f;
  opacity: 0.45;
}
.k-edit-form-container .k-edit-label {
  color: var(--cc-muted);
  font-weight: 500;
}
.k-edit-form-container .k-edit-buttons {
  background: var(--cc-band);
  border-color: var(--cc-border);
}

/* ---------- Bootstrap pieces used by the pages ---------------------------- */

.table > thead > tr > th {
  color: var(--cc-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--cc-border);
}
.table > tbody > tr > td,
.table > thead > tr > th {
  border-color: var(--cc-border);
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--cc-surface-2);
}
.table > tbody > tr:hover {
  background: var(--cc-row-hover);
}
.well {
  background: var(--cc-band);
  border: 0;
  border-radius: var(--cc-radius);
  box-shadow: none;
}
.panel {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: none;
}
.panel-default > .panel-heading {
  background: var(--cc-band);
  color: var(--cc-ink);
  border-color: var(--cc-border);
}
.thumbnail {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
}
/* alerts: white box with a coloured bar on the left (site's info message) */
.alert {
  background: var(--cc-surface);
  color: var(--cc-text);
  border: 0;
  border-left: 4px solid var(--cc-info);
  border-radius: 0;
  box-shadow: var(--cc-shadow);
}
.alert-warning { border-left-color: var(--cc-warning); }
.alert-danger  { border-left-color: var(--cc-danger); }
.alert-success { border-left-color: var(--cc-success); }
.alert-info    { border-left-color: var(--cc-info); }
.close {
  color: var(--cc-text);
  text-shadow: none;
}

/* ---------- dark mode: library assets drawn for light backgrounds --------- */

/* Kendo's sprite icons are dark grey; lighten them on the night sky */
:root[data-theme="dark"] .k-icon,
:root[data-theme="dark"] .k-sprite {
  filter: invert(0.88) hue-rotate(180deg);
}
:root[data-theme="dark"] .k-list .k-item.k-state-selected,
:root[data-theme="dark"] .k-pager-numbers .k-state-selected {
  color: var(--cc-on-primary);
}
:root[data-theme="dark"] .k-loading-mask .k-loading-color {
  background: var(--cc-bg);
}
