/*
	Global
*/

html {
	height: 100%;
}

body {
	overflow: hidden;
	height: 100%;
	margin: 0;
	padding: 40px 0 0 0;
}

body, input, button, select, textarea, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
	font-family: "Calibri W99";
}

.alert i {
	padding-right: 6px;
}

.buttonbar-center {
	text-align: center;
}

label {
	font-family: "Calibri W99";
}

.modal {
	/* Bootstrap override */
	overflow-y: auto;
	/* Make z-index high enough that it won't overlap with constantly incrementing GXT z-index */
	z-index: 2440;
}

.modal-dialog {
	z-index: 2450;
}

.select2-dropdown {
	/* Place select2's atop modal dialogs */
	z-index: 3051;
}

form.form-horizontal .help-block {
	/* Bootstrap override */
	margin-bottom: 0;
}

.grid-form_loading {
	cursor: wait;
}

div.grid-control-bar {
	margin-bottom: 6px;
	display: flex;
	align-items: center;
}

div.grid-control-bar__pagination {
	flex-grow: 1;
}

.grid-control-bar__pages {
	min-width: 50px;
}

td.backgrid-cell-validation-error {
	outline: 1px solid red;
	font-style: italic;
	color: #d60236;
}

td.backgrid-cell-validation-error * {
	font-style: normal;
}

tr.backgrid-row-changed {
	background-color: #ffffdd;
}

tr.backgrid-row-new {
	background-color: #ccfad5;
}

tr.backgrid-row-errors {
	background-color: #f7ebeb;
}

i.tooltip-icon {
	font-size: 1.1em;
	color: #555;
}

.tooltip {
	font-family: inherit;
	font-size: inherit;
}

.buttons-standard .btn {
	text-transform: uppercase;
}

@media (min-width: 768px) {
	.modal-dialog.multiselect-dialog {
		width: auto;
		min-width: 350px;
		max-width: 600px;
	}
}

.multiselect-box {
	max-height: 450px;
	overflow: auto;
}

.multiselect-box .checkbox {
	margin-top: 0;
	margin-bottom: 0;
}

.multiselect-box .checkbox + .checkbox {
	margin-top: 0;
	margin-bottom: 0;
}

.multiselect-box .checkbox:nth-child(even) {
	background: #f8f8f8;
}

.multiselect-box label {
	display: block;
	padding-top: 3px;
	padding-bottom: 3px;
}

/*
	Message box
*/

.mb-icon {
	font-size: 32px;
}

.mb-body {
	overflow: auto;
	max-height: 500px;
}

/*
	Login form
*/

div.login.modal {
	z-index: 1041; /* Place under message boxes */
}

.login .modal-dialog {
	width: 400px;
	z-index: 1042; /* Place under message boxes */
}

.login-image {
	text-align: center;
}

.login-top-image {
	margin: 25px;
}

.login-top-image img {
	width: 200px;
	height: 50px;
}

.login .modal-footer {
	margin-top: 15px; /* We used to rely on this in bootstrap 3.0 */
	padding: 15px 5px 15px 5px;
}

.login-bottom-image {
	margin: 0;
	padding: 0; 
}

.login-bottom-image img {
	max-width: inherit;
	width: 250px;
	height: 205px;
}

.login .modal-body {
	padding: 0;
}

#build-info {
	text-align: center;
}

#browser-info {
    text-align: center;
}

.login .alert-area {
	display: none;
}

.login .alert {
	margin-left: auto;
	margin-right: auto;
	width: 350px;
	text-align: center;
}

.login .form-horizontal .control-label {
	margin-left: 10px;
}

.login .btn {
	font-family: "Calibri W99";
	font-weight: bold;
	font-size: 16px;
	text-transform: uppercase;
	min-width: 100px;
}

#forgot-password-wrapper {
	margin-bottom: 1rem;
	text-align: center;
}

#login-form-auth-code-area {
	height: 0;
	overflow: hidden;
	transition: height 0.5s ease-in;
}

#login-form-auth-code-area > .form-group {
	margin-bottom: 0;
}

#login-form-auth-code-area.visible {
	height: 95px;
}

#login-form-auth-code-area label {
	margin-left: 0;
	text-align: center;
	padding-top: 0;
}

#login-form-auth-code-area input {
	width: 50%;
	margin: auto;
	text-align: center;
}

#login-form-scratch-code {
	text-transform: uppercase;
}

.login-form__tfa-help-block-wrapper {
	text-align: center;
	height: 22px;
	overflow: hidden;
}

.login-form__tfa-link-wrapper {
	text-align: center;
}

/*
	Workspace
*/

#workspace-alert-area {
	position: fixed;
	top: 40px;
	left: 0;
	right: 0;
	z-index: 1030;
	height: 50px;
	overflow: hidden;
	border-radius: 0;
	display: none;
}

/*
	Navbar
*/

.navbar {
	min-height: 40px;
}

.navbar-brand {
	font-family: "Calibri W99";
	font-weight: bold;
	padding: 0px 12px;
	font-size: 16px;
	line-height: 40px;
	height: auto; /* latest bootstrap defines height: 50px */
}

.navbar-nav > li > a {
	padding-top: 0px;
	padding-bottom: 0px;
	line-height: 40px;
}

.navbar-text {
	margin-top: 0;
	margin-bottom: 0;
	line-height: 40px;
}

.navbar-form {
	margin-top: 5px;
	margin-bottom: 5px;
}

.navbar-toggle {
	margin-top: 2px;
	margin-bottom: 2px;
}

.navbar-fixed-top {
	margin-left: 0;
	margin-right: 0;
}

.navbar-inverse .navbar-brand, .navbar-inverse .nav > li > a {
	color: #c0c0c0;
}

.navbar-nav .open .dropdown-menu.countries {
	background: white;
}

.navbar-form .form-control {
	width: auto;
}

.navbar-form .input-group {
	display: inline-table;
}

.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn,
.navbar-form .input-group .form-control {
    width: auto;
}

#header-login {
	max-width: 100px;
 	white-space: nowrap;
	text-overflow: ellipsis;
	overflow:hidden;
}

/* Begin navbar responsive support */

.navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse {
	/* Override Bootstrap default max-height */
    max-height: calc(100vh - 40px);
}

.navbar-nav.navbar-nav-sticky {
	float: left;
	margin: 0;
}

.navbar-nav.navbar-nav-sticky li,
.navbar-nav.navbar-nav-sticky li > a {
	display: inline;
}

@media (max-width: 399px) {
	/* Non-collapsible menu items in collapsed mode on very narrow screens */
	.nav.navbar-nav-sticky > li > a {
		padding-left: 5px;
		padding-right: 5px;
	}
}

i.navbar-icon {
	font-size: 18px;
	position: relative;
	top: 2px;
}

i.navbar-shrink-icon,
i.logout-icon {
	display: none;
}

/* Begin cutoff timer */

.cutoff-timer {
	padding-left: 4px;
	padding-right: 4px;
}

.cutoff-timer_alert, .navbar-inverse .cutoff-timer_alert {
	background: #d60236;
	color: white;
}

@media (min-width: 768px) {
	.navbar-right {
		margin-right: 0; /* Override latest bootstrap change */
	}
	
	i.logout-icon {
		display: inline-block;
	}
	
	span.logout-text {
		display: none;
	}
}

@media (min-width: 320px) {
	/* Display search button to the right of input except on very narrow screens */
	.navbar-form .form-control {
	    display: inline-block;
	    width: auto;
	    vertical-align: middle;
	}
}

@media (min-width: 1440px) {
    #header-login {
        max-width: 200px;
    }
}

@media (min-width: 1330px) and (max-width: 1439px) {

    #header-login {
        max-width: 150px;
    }
}

@media (min-width: 1190px) and (max-width: 1329px) {
    .navbar .brand {
        padding-right: 10px;
    }
    
    .navbar .nav > li > a {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .navbar-text {
        margin-left: 10px;
        margin-right: 10px;
    }
}

@media (max-width: 1189px) {
	.navbar .brand {
		padding-right: 5px;
	}
	
	.navbar .nav > li > a {
		padding-left: 5px;
		padding-right: 5px;
	}
	
	.navbar-text {
		margin-left: 5px;
		margin-right: 5px;
	}
}

@media (max-width: 1279px) {
	.countries-link {
		padding-left: 5px;
		padding-right: 5px;
		max-width: 150px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
}

@media (min-width: 768px) and (max-width: 1092px) {
	.countries-link {
		max-width: 120px;
	}
}

@media (min-width: 768px) and (max-width: 1092px) {
	/* On narrow screens where navbar is not collapsed, collapse help and contact links */
	i.navbar-shrink-icon {
		display: inline-block;
	}
	
	span.navbar-shrink-text {
		display: none;
	}
	
	#header-search-input {
		width: 120px;
	}
	
	#navbar-brand-logo {
		display: none;
	}
}

@media (min-width: 768px) and (max-width: 992px) {
	#header-search-input {
		width: 100px;
	}
}

@media (max-width: 899px) {
	.navbar-brand {
		padding: 0;
	}
	
	#navbar-brand-text {
		display: none;
	}
	
	#navbar-brand-logo {
	    display: block;
	    width: 32px;
	    height: 32px;
	    margin: 4px;
		background-image: url(../img/navbar-icon.png);
	}
}

@media (max-width: 767px) {
	.navbar-nav.navbar-nav-sticky li,
	.navbar-nav.navbar-nav-sticky li > a {
		display: inline-block;
		float: left;
	}
	
	#header-filter .countries-link {
		display: inline-block;
		max-width: 90px;
		height: 32px;
		float: none;
	}
	
	.navbar-nav .open .dropdown-menu.countries {
		position: absolute;
		left: -35px;
		border: 1px solid rgba(0, 0, 0, 0.15);
		box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
	}
}

/* End navbar responsive support */

/* Begin countries block */
.countries
{
}

.countries-display, countries, .countries-filter
{
	width: 140px;
}

.countries-filter
{
	border: 1px solid #999;
	margin: 3px;
	padding: 1px;
}

.countries-filter::-webkit-input-placeholder
{
	color: #333;
}

.countries-filter:-moz-placeholder
{
	color: #333;
}

.countries-filter::-moz-placeholder
{
	color: #333;
}

.countries-filter::-ms-input-placeholder
{
	color: #333;
}

.countries-list
{
	overflow-y: scroll;
	overflow-x: hidden;
	max-height: 305px;
	white-space: nowrap;
}

.countries-list input, .locations-list input {
	margin: 0 4px 0 0;
}

.countries-list label, .locations-list label
{
	margin: 0;
	display: inline-block;
	overflow: hidden;
	white-space: nowrap;
	vertical-align: middle;
	max-width: 125px;
	font-family: "Calibri W99";
	font-weight: normal;
}
/* End countries block */

/* Order */

input.attach-dialog-file-input, input.upload-dialog-file-input {
	margin: auto;
}

div.attach-dialog button.btn, div.upload-dialog button.btn {
	text-transform: uppercase;
}

div.attach-dialog div.progress,
div.upload-dialog div.progress,
div.attach-dialog-preview {
	margin-top: 20px;
}

div.attach-dialog-file-hint {
	text-align: center;
	margin-top: 6px;
}

/* Settings */

div.base-form {
	background: white;
	padding-left: 12px;
	padding-right: 12px;
	overflow: auto;
}

h3.base-form-title {
	margin-top: 12px;
	padding-bottom: 3px;
	border-bottom: 1px solid #aaa;
	margin-bottom: 14px;
}

.settings-search {
	display: flex;
	align-items: center;
}

.settings-search__button-area {
	padding-left: 12px;
}

.settings-search__button-row {
	text-align: right;
}

#default-country-settings {
	max-width: 400px;
}

#merge-users-settings {
	max-width: 400px;
}

#webhookstatus-urlbar {
	width: 400px;
}

#password-settings {
	max-width: 400px;
}

#test-page-links {
	position: absolute;
	margin-top: -40px;
	margin-left: 200px;
}

#test-page-links a {
	margin-right: 20px;
}

#test-page {
	max-width: 500px;
}

#test-email {
	max-width: 500px;
}

.webstore-api-view {
	max-width: 500px;
	border: 1px solid #aaa;
	padding: 5px 10px;
	margin-bottom: 10px;
}

.express-cards-search {
	flex-wrap: wrap;
}

.express-cards-search__right-column {
	min-width: 420px;  /* prevent size change on load */
}

.express-cards-search__right-column label {
	padding-left: 25px;
}

.express-cards-search__button-area {
	padding-left: 0;
	white-space: nowrap;
}

#express-card-import-settings {
	max-width: 400px;
}

.swiss-post-settings {
	max-width: 500px;
}

.swiss-post-settings h4:not(:first-of-type) {
	margin-top: 22px;
}

#tracking-import-settings {
	max-width: 400px;
}

.override-edit-dialog .modal-dialog {
	width: 500px;
}

.override-edit-dialog__items {
	height: calc(100vh - 300px);
	overflow-y: auto;
	padding-right: 5px;
}

.override-edit-dialog__items textarea {
	width: 100%;
}

.override-edit-dialog__bulk-add-button {
	position: absolute;
	left: 16px;
}

.bulk-override-add-dialog__countries {
	height: 300px;
	overflow-y: auto;
	margin-bottom: 16px;
}

.tfa-settings {
	max-width: 400px;
}

.tfa-settings > div {
	margin-bottom: 15px;
}

.tfa-settings__button-bar {
	text-align: right;
}

.tfa-backup-codes-dialog__list {
	font-size: 24px;
	list-style-type: none;
	padding-left: 0;
	text-align: center;
}

/* End settings */

/* Image processing */

#image-processing-adjust-overlay {
	background: white;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 50;
}

#image-processing-adjust-button-bar {
	height: 45px;
	z-index: 200;
	padding: 5px;
    position: absolute;
    bottom: 0;
    background: #f0f0f0;
    width: 100%;
    border-top: 1px solid #ccc;
    text-align: center;
}

#image-processing-adjust-button-bar .image-processing-adjust-cancel {
	/* pull right without messing up save button */
	position: absolute;
	right: 5px;
}

#image-processing-adjust-button-bar i.fa {
	margin-right: 3px;
}

#image-processing-adjust-previewer-container {
	height: calc(100% - 45px);
	background-color: #dfdfdf;
	background-image: url(
		data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEXf39////8zI3BgAAAAEUlEQVQI12P4z8CAFWEX/Q8Afr8P8erzE9cAAAAASUVORK5CYII=
	);
	background-repeat: repeat;
	background-attachment: fixed;
}

#image-processing-adjust-previewer-container div.previewer-controls {
	height: 77px;
	padding: 8px 0;
	background: #f0f0f0;
	border-bottom: 1px solid #ccc;
}

#image-processing-adjust-previewer-container div.previewer-wrapper {
	/* Needed to avoid padding mismatch for image max-height: inherit */
	box-sizing: content-box;
}

#image-processing-adjust-previewer-container img.previewer-image {
	max-height: inherit;
}

/* End image processing */

/* Shipments */

.shipment-editor {
	padding-bottom: 18px;
}

.shipment-editor__button-bar {
	text-align: center;
}

.shipment-editor__button-bar > span {
	display: inline-block;
	margin-top: 12px;
}

.shipment-editor__right-button {
	margin-left: 3em;
}

.shipment-editor .row {
	margin-left: 0;
	margin-right: 0;
}

.shipment-editor .row:nth-child(even) {
	background: #f4f4f4;
}

.shipment-editor__header-row {
	text-align: center;
	padding-bottom: 12px;
}

.shipment-editor .form-group {
	margin-bottom: 5px;
}

.shipment-editor__soft-validation {
	color: #777;
}

.shipment-editor__matching-orders-container {
	margin-top: 18px;
	margin-bottom: 6px;
}

/* GXT Bootstrap overrides */

.gxtToplevel div, .gxtToplevel label, .gxtToplevel input {
	font-size: 13px!important;
	font-family: "Calibri W99"!important;
}

.gxtToplevel div.bootstrapFragment, .gxtToplevel div.bootstrapFragment div, .gxtToplevel div.bootstrapFragment label,
.gxtToplevel div.bootstrapFragment input {
	font-size: inherit!important;
}

.gxtToplevel *,
.gxtToplevel *:before,
.gxtToplevel *:after {
	/* Bootstrap override */
  	-webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
}

.gxtToplevel .bootstrapFragment *,
.gxtToplevel .bootstrapFragment *:before,
.gxtToplevel .bootstrapFragment *:after {
	/* Reset to Bootstrap values */
  	-webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.gxtToplevel label {
	font-weight: normal;
	margin-bottom: 0;
}

.gxtToplevel .bootstrapFragment label {
	/* Reset to Bootstrap values */
	font-weight: bold;
	margin-bottom: 5px;
}
