/* ── Custom properties ───────────────────────────── */

:root {
    /* Colours */
    --color-text-primary: #46464a;
    --color-text-muted: #999;
    --color-accent: #007aff;
    --color-border-input: #eff0fa;
    --color-border-ui: #dbe0e4;
    --color-invalid: #ff2d55;
    --color-page-bg: #f0f0f2;

    /* Bulma theme overrides */
    --bulma-primary-h: 215deg;
    --bulma-primary-l: 61%;
    --bulma-link-h: 263deg;
    --bulma-link-l: 72%;
    --bulma-info-h: 240deg;
    --bulma-info-s: 5%;
    --bulma-info-l: 58%;
    --bulma-success-h: 137deg;
    --bulma-success-s: 63%;
    --bulma-success-l: 39%;
    --bulma-warning-h: 39deg;
    --bulma-warning-l: 50%;
    --bulma-danger-h: 352deg;
    --bulma-danger-s: 81%;
    --bulma-danger-l: 60%;
    --bulma-family-primary: Lato, Arial, sans-serif;
    --bulma-family-secondary: Lato, Arial, sans-serif;
    
    --bds-density-factor: 1;
    --bds-input-hover-border-color: #e1e2ec;
    --bds-input-border-color: #eff0fa;
    --bds-input-focus-border-color: #007aff;
    --bds-input-focus-shadow-color: #ebf5ff;
    --bds-input-text-prefix-color: #7b7b7b;
    --bds-input-text-suffix-color: #7b7b7b;
}

/* ── Base ────────────────────────────────────────── */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-color: var(--color-page-bg);
    /* 105vh prevents a background colour flash at the bottom of short pages */
    min-height: 105vh;
    /*padding-bottom: 82px !important;*/
    padding-top: 20px !important;
    margin-bottom: 60px !important;
}

html, body {
    font-family: var(--bulma-family-primary) !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    margin-top: 24px !important;
}

h1:focus {
    outline: none;
}

h1.title, .title-icon {
    letter-spacing: 0.65px;
    text-size-adjust: 100%;
    line-height: 32px;
    font-weight: 400;
    font-size: 24px !important;
    text-transform: uppercase !important;
}

span {
    line-height: 1 !important;
}

hr {
    margin-top: 12px;
    margin-bottom: 6px;
}

a, .btn-link {
    color: #0071c1;
}

/* ── Banner ──────────────────────────────────────── */

.banner-text-label {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: normal;
    color: var(--color-text-muted);
}

.banner-text-value {
    padding-right: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #61646d;
}

.banner-text-divider::before {
    color: #e1e7eb;
    content: "|";
    display: inline-block;
    padding-right: 15px;
}

/* ── Notifications ───────────────────────────────── */

.notification-list {
    position: fixed;
    width: 300px;
    top: 5px;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    height: auto;
    overflow: visible;
}

.hx-notification {
    margin: 0;
    position: relative;
    width: 300px;
    animation-name: notification-slide;
    animation-duration: 0.5s;
}

@keyframes notification-slide {
    0% {
        opacity: 0.5;
        right: -300px;
    }
    100% {
        opacity: 1;
        right: 0;
    }
}

.is-sticky-notification {
    position: sticky !important;
    top: 56px;
    z-index: 999;
}

/* ── Tags ────────────────────────────────────────── */

span.tag.is-rounded.is-transparent {
    border: 1px solid black;
    box-sizing: border-box;
    background: transparent;
    margin-right: 4px;
    padding-right: 8px;
    padding-left: 0;
    min-width: 24px;
}

span.tag > .tag, .tag.gender {
    font-weight: bold;
    box-sizing: border-box;
    width: 24px;
    position: relative;
    top: -1px;
    left: -1px;
    color: #fff !important;
}

span.tag > span.ml-1 {
    font-weight: bold;
    box-sizing: border-box;
    min-height: 24px !important;
    line-height: 15px !important;
}

/* ── Striped backgrounds ─────────────────────────── */

.success-striped,
.warning-striped,
.danger-striped,
.info-striped {
    background-size: 56.57px 56.57px;
}

.success-striped {
    background-image: linear-gradient(45deg, #defbe6 25%, #fff 25%, #fff 50%, #defbe6 50%, #defbe6 75%, #fff 75%, #fff 100%);
}

.warning-striped {
    background-image: linear-gradient(45deg, #fff5e0 25%, #fff 25%, #fff 50%, #fff5e0 50%, #fff5e0 75%, #fff 75%, #fff 100%);
}

.danger-striped {
    background-image: linear-gradient(45deg, #ffecea 25%, #fff 25%, #fff 50%, #ffecea 50%, #ffecea 75%, #fff 75%, #fff 100%);
}

.info-striped {
    background-image: linear-gradient(45deg, #e9f2ff 25%, #fff 25%, #fff 50%, #e9f2ff 50%, #e9f2ff 75%, #fff 75%, #fff 100%);
}

/* ── Forms ───────────────────────────────────────── */

.label {
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 400;
}

.field.is-grouped > .label {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    vertical-align: middle;
}

.field.has-addons.is-fullwidth {
    margin-bottom: 0;
}

.field.is-grouped > .control > * {
    height: 100%;
}

.input, .input:focus {
    border: none;
    box-shadow: none;
}

/*.input {*/
/*    color: #7b7b7b;*/
/*    font-size: 14px;*/
/*    letter-spacing: 0.2px;*/
/*    border-radius: 8px;*/
/*    border: 2px solid var(--color-border-input);*/
/*    outline: none !important;*/
/*    min-height: 40px;*/
/*}*/

/*.input:read-only, .input.readonly {*/
/*    color: #3c3c3c;*/
/*    box-shadow: none !important;*/
/*    border: 2px solid #d3d3d3 !important;*/
/*    background: #d3d3d3 !important;*/
/*}*/

/*.input:invalid, .input.invalid {*/
/*    border: 2px solid var(--color-invalid) !important;*/
/*    background: #fff !important;*/
/*}*/

/*.input:invalid:focus,*/
/*.input.invalid:focus,*/
/*.input:invalid:focus-visible,*/
/*.input.invalid:focus-visible,*/
/*.input:invalid:hover,*/
/*.input.invalid:hover {*/
/*    box-shadow: 0 0 0 4px #ffe6eb;*/
/*    border: 2px solid var(--color-invalid);*/
/*}*/

/*.input:valid:focus,*/
/*.input.valid:focus,*/
/*.input:valid:focus-visible,*/
/*.input.valid:focus-visible,*/
/*.input:valid:hover,*/
/*.input.valid:hover {*/
/*    border: 2px solid var(--color-accent);*/
/*    background: #fff;*/
/*    box-shadow: 0 0 0 3px rgba(66, 88, 255, 0.25);*/
/*}*/

/*input[type=checkbox] {*/
/*    cursor: pointer;*/
/*    scale: 1.2;*/
/*}*/

.is-grouped input[type=checkbox] {
    transform: scale(1.3);
    margin-left: 8px;
}

.help.is-danger {
    font-size: 16px;
}

/* ── Modals ──────────────────────────────────────── */

.modal {
    min-width: 90vw;
    min-height: 80vh;
}

.modal-card {
    border-radius: 8px;
}

.modal-card.modal-card-size-l{
    min-width: 90vw;
    min-height: 80vh;
}

.modal-card.modal-card-size-m{
    min-width: 70vw;
    min-height: 60vh;
}

.modal-card.modal-card-size-s{
    min-width: 50vw;
    min-height: 60vh;
}

.modal-card-head {
    padding: 24px;
    box-shadow: none;
}

.modal-card-title {
    letter-spacing: 0.3px;
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.modal-card-body {
    background: #fff;
}

/* ── Bottom menu ─────────────────────────────────── */

.bottom-menu {
    border-top: 1px solid var(--color-border-ui);
    position: fixed;
    height: 60px;
    padding: 10px;
    box-shadow: none !important;
    border-radius: 0 !important;
    bottom: 0;
    margin: 0 !important;
    left: 0;
    width: 100%;
    z-index: 40;
}

/* ── Loading ─────────────────────────────────────── */

.loading-info {
    position: fixed;
    z-index: 9999;
    height: 20vh;
    top: 40vh;
    width: 16vw;
    left: 42vw;
    opacity: 1;
}

.loader {
    animation: spin 1s linear infinite;
    border: 16px solid #f3f3f3;
    border-radius: 50%;
    border-top: 16px solid #3498db;
    height: 120px;
    left: calc(50% - 60px);
    position: fixed;
    top: calc(50% - 60px);
    transform: scale(3);
    width: 120px;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

/* ── Navigation ──────────────────────────────────── */

.menu-list a {
    background: transparent;
}

.menu-list a:hover {
    background: rgba(0, 0, 0, 0.05);
}

nav.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar {
    display: none;
}

th {
    text-transform: uppercase;
}

/* ── Tabs ────────────────────────────────────────── */

.tabs li a{
    border:none;
}

.tabs li.is-active a{
    color:var(--bds-color-accent-bold-10);
}

.tabs li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0px -1px;
    padding: var(--bds-spacer-inset-m) var(--bds-spacer-content-4);
    color: var(--bds-color-text-tertiary);
    font-family: var(--bds-typography-font-family-default);
    font-size: var(--bds-typography-font-size-4);
    font-weight: var(--bds-typography-font-weight-normal);
    font-style: normal;
    line-height: var(--bds-typography-line-height-4);
    letter-spacing: var(--bds-typography-letter-spacing-normal);
    text-decoration: none;
    border: var(--bds-border-width-l) solid transparent;
    background: none;
    cursor: pointer;
}

.tabs li:after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    display: block;
    width: 100%;
    height: 2px;
    margin: 0 auto;
    background-color: var(--bds-color-divider-10);
    transition: all 0.1s ease;
    content: '';
}

.tabs a {
    padding:0;
}

.tabs li.is-active:after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    border-radius:2px;
    display: block;
    width: 100%;
    height: 2px;
    margin: 0 auto;
    background-color: var(--bds-color-accent-bold-10);
    transition: all 0.1s ease;
    content: '';
}

.tabs ul {
    border-bottom: 2px solid transparent !important;
}

a.tab:focus, a.tab:focus-visible {
    border-color: #485fc7;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
    outline: none;
}

/* ── Table ───────────────────────────────────────── */

tbody > tr:hover {
    background-color: #f7f7f7 !important;
}

/*th {*/
/*    color: var(--color-text-primary);*/
/*    font-size: 14px;*/
/*    font-weight: 400;*/
/*    padding: 12px 8px;*/
/*}*/

tr {
    border-bottom: 2px solid rgba(0, 0, 0, 0.03) !important;
}

tr:last-child {
    border-bottom: none !important;
}

td {
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.2px;
    vertical-align: middle !important;
}

/* ── Filter ──────────────────────────────────────── */

.filter-item {
    font-size: 0;
    margin-left: 1px;
    margin-right: 5px;
    margin-bottom: 0;
    white-space: nowrap;
    background: #fff;
    display: inline-block;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
}

/* ── Boxes and cards ─────────────────────────────── */

.box {
    margin-bottom: 0;
}

.box, .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 2px rgba(0, 0, 0, 0.06);
    border-radius: 8.4px;
}

.card-header {
    margin-top: 16px;
    margin-bottom: 16px;
    box-shadow: none;
    text-transform: uppercase;
}

.card-header-title {
    font-size: 18px;
    padding-top: 24px;
    padding-left: 24px;
}

.card > .card-content {
    margin-top: 0;
    padding-top: 0;
}

/* ── Buttons ─────────────────────────────────────── */


.button.is-small {
    font-weight: var(--bds-component-button-text-m-font-weight);
    font-size: 12px;
}

.button {
    font-weight: var(--bds-component-button-text-m-font-weight);
    font-size: var(--bds-component-button-text-m-font-size);
}



.button.is-large {
    font-weight: var(--bds-component-button-text-l-font-weight);
    font-size: var(--bds-component-button-text-l-font-size);

}

.button.is-danger, .button.is-link, .button.is-dark, .button.is-primary, .button.is-success {
    color: #fff !important;
}

.button.is-light, .button.is-static {
    background: var(--color-border-input);
    color: #000 !important;
}

.button.is-light:hover {
    background-color: #e1e2ec;
}

.button.bp-menu-item {
    font-weight: var(--bds-component-button-text-m-font-weight);
    font-size: 20px !important;
    padding-top:12px;
    padding-bottom:12px;
}

.no-spin-buttons::-webkit-inner-spin-button,
.no-spin-buttons::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.no-spin-buttons[type='number'] {
    appearance: textfield;
}

/* ── Misc ────────────────────────────────────────── */

.content {
    padding-top: 1.1rem;
}

.index-relation {
    height: 100%;
    vertical-align: middle !important;
}

/* ── Desktop layout ──────────────────────────────── */

@media screen and (min-width: 999999px) {

    html {
        margin-top: 0 !important;
        padding-top: 0 !important;
        margin-left: 0;
    }

    body {
        margin-left: 96px;
    }

    .navbar {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        background-color: #fff;
        width: 80px;
        display: flex !important;
        flex-direction: column;
        height: 100vh;
        border-right: 1px solid var(--color-border-ui);
        padding-left: 6px;
        padding-right: 6px;
        z-index: 30;
        justify-content: space-between;
        align-content: flex-start;
    }

    .sidebar .navbar-end {
        display: flex;
        flex-direction: column;
    }

    .sidebar a {
        display: flex;
        padding-top: 6px;
        padding-bottom: 6px;
        margin-bottom: 3px;
        width: 42px;
        height: 42px;
        justify-content: space-around;
        align-content: space-around;
    }

    .navbar-brand > .navbar-item {
        width: 42px !important;
        margin-left: 4px;
    }

    .control > .button.is-static {
        height: 100%;
    }
}

/* ---- Camera pack scanner ---- */
/* The preview and the crop guide over it. The guide is only a guide: the crop the decoder actually reads
   is set in lib/camerascanner.js and the two are kept the same by CameraPackScanner. */

.camera-scanner-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    background: #000;
    /* Keeps the guide's dimming shadow over the preview. Without it the shadow's 100vmax spread dims the
       whole page and the crop box reads as no box at all. */
    overflow: hidden;
}

.camera-scanner-video {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.camera-scanner-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Two borders so the box is visible against a dark pack and a bright one */
    border: 2px solid #ffd400;
    outline: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transition: width 0.1s linear, height 0.1s linear;
}
