.navbar-brand img {
	display: block;
	margin: 0 0 2px;
	/* Päävalikon ikonit 24px:iin, jotta kaikki kohdat mahtuvat riville. */
	height: 24px;
	width: auto;
}


/* Datepicker z-index fix */
.ui-datepicker {
	z-index: 10 !important;
}

/* Fix split dropdown on smaller devices */
.invoice_row_actions .btn-group {
	width: 100px;
}

/* Fix Shake effect */
.ui-effects-wrapper {
  display:inline;
}

/* Fix iOS zoom on forms */
@media screen and (-webkit-min-device-pixel-ratio:0) {
	select,
	textarea,
	input {
		font-size: 16px;
	}
}

@page {
	size: A4 portrait;
}

/* (Print styles are defined at the end of this file so they override the
   screen rules above regardless of source order.) */

/* Pagination pointer */
.pagination a {
	cursor: pointer;
}

/* Pagination links shouldn't pick up the global link hover underline. */
.pagination a:hover, .pagination a:focus {
	text-decoration: none;
}

/* Pagination top margin */
.pagination {
	margin: 0px;
}

.breadcrumb {
	background-color: #FDF5E6;
}

body.production div.background {
	background: url(/images/production.jpg) no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}

body.development div.background {
	background: url(/images/sandbox.jpg) no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}

div.background {
	opacity: 0.5;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	position: fixed;
	z-index: -1;
}

section div.container {
	background-color: #fff;
	box-sizing: border-box;
	border: 1px solid transparent;
	border-radius: 4px;
	margin-top: 18px;
	padding-top: 18px;
	padding-bottom: 18px;
}

/* Mobile: containers are full-width (no max-width below 576px) and bleed to the
   screen edges, hiding the content under the background image's side strips.
   Give them an 18px side margin — the same gap as between the navbar and the
   breadcrumb — so the white panels sit in a tidy frame instead of edge-to-edge.
   width:auto is required because Bootstrap's .container is width:100%, which
   would otherwise overflow once margins are added. */
@media (max-width: 575.98px) {
	.container {
		width: auto;
		margin-left: 18px;
		margin-right: 18px;
	}
}

/* Page title: slightly smaller than BS5's 2rem default. */
section h2 {
	font-size: 1.6rem;
}

/* File upload button */
.btn-file {
    position: relative;
    overflow: hidden;
}
.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}
input[readonly] {
  background-color: white !important;
  cursor: text !important;
}

.file-upload {
	width: 80%;
}

.file-upload .input-group-btn {
	width: 1% !important;
}

/* Firefox fieldset workaround */
@-moz-document url-prefix() {
  fieldset { display: table-cell; }
}

/* Saalisapinoinnit alhaalla päin */

body {
	padding: 0;
	background: #fff;
	color: #262626;
	font-family: Helvetica, Verdana, sans-serif;
	-webkit-overflow-scrolling: auto;
}

ol, ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.center {
	text-align: center;
}

/*************************
		Navigation
*************************/

.navbar {
	border-radius: 0;
}

.navbar-default {
	position: relative;
	z-index: 50;
	width: 100%;
	min-height: 0;
	border: none;
	background-color: #FDF5E6;
	box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.1);
}

/* Bootstrap 5: the icon nav was a BS3 floated layout; undo BS5's flex
   squeeze on the wrapper row and let the items size to their labels. */
.navbar-default > .container > .row {
	display: block;
}

ul.navbar-nav {
	padding: 8px 0;
	margin: 0 0;
	width: 100%;
	flex-wrap: wrap;
	justify-content: flex-start;
}

.navbar-nav li {
	text-align: center;
	flex: 0 0 auto;
	padding: 0 6px;
}

.navbar a {
	padding: 2px 6px;
	color: #777;
	text-transform: uppercase;
	font-weight: bold;
	font-size: 14px;
	line-height: 1.4em;
	outline: none;
}

.navbar a.active, .navbar a:hover, .navbar a>:focus {
	color: #000;
}

/* Navbar links never underline, even on hover. */
.navbar a:hover, .navbar a:focus {
	text-decoration: none;
}

/* Stack icon + label tightly. inline-flex column avoids the phantom inline
   line box that BS5's navbar-brand font-size adds, which was inflating height. */
a.navbar-brand {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	height: auto;
	line-height: 1.1;
	margin: 0;
	padding: 4px 0;
}

/* labels under the icons: kill the default <p> margin */
.navbar-brand p {
	margin: 0;
	font-size: 13px;
}

/* Breadcrumb: BS5 dropped the BS3 pill styling and the markup has no
   .breadcrumb-item, so restore the light rounded bar, separators and spacing. */
.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	flex: 1;
	margin: 18px 0 0;
	padding: 10px 16px;
	list-style: none;
	background-color: #FDF5E6;
	border-radius: .375rem;
}

.breadcrumb > li + li::before {
	content: "/";
	padding: 0 10px;
	color: #999;
}

.breadcrumb > li.active {
	color: #6c757d;
}

/* BS5 btn-toolbar no longer spaces its btn-groups (BS3 added margins);
   restore a gap so action buttons in page headers aren't glued together. */
.btn-toolbar {
	gap: .5rem;
}

/* Käytä BS3:n top-kohdistusta (kuten ennen BS5-päivitystä). Näin monirivisetkin
   rivit (esim. lisätekstikenttä omalla rivillään) asettuvat luonnostaan oikein:
   muut solut ovat ensimmäisen rivin tasalla eivätkä keskitettyinä. */
.table > :not(caption) > * > * {
	vertical-align: top;
}

/* Contextual row colours back to BS3's lighter, higher-contrast shades
   (BS5's muted greens/reds read poorly). */
.table-success {
	--bs-table-color: #3c763d;
	--bs-table-bg: #dff0d8;
	--bs-table-striped-bg: #dff0d8;
	--bs-table-striped-color: #3c763d;
	--bs-table-hover-bg: #d0e9c6;
	--bs-table-hover-color: #3c763d;
	--bs-table-border-color: #d6e9c6;
}

.table-danger {
	--bs-table-color: #a94442;
	--bs-table-bg: #f2dede;
	--bs-table-striped-bg: #f2dede;
	--bs-table-striped-color: #a94442;
	--bs-table-hover-bg: #ebcccc;
	--bs-table-hover-color: #a94442;
	--bs-table-border-color: #ebccd1;
}

.table-warning {
	--bs-table-color: #8a6d3b;
	--bs-table-bg: #fcf8e3;
	--bs-table-striped-bg: #fcf8e3;
	--bs-table-striped-color: #8a6d3b;
	--bs-table-hover-bg: #faf2cc;
	--bs-table-hover-color: #8a6d3b;
	--bs-table-border-color: #faf2cc;
}

.table-info {
	--bs-table-color: #31708f;
	--bs-table-bg: #d9edf7;
	--bs-table-striped-bg: #d9edf7;
	--bs-table-striped-color: #31708f;
	--bs-table-hover-bg: #c4e3f3;
	--bs-table-hover-color: #31708f;
	--bs-table-border-color: #bce8f1;
}

/* A plaintext value (e.g. product name) used inside an input-group isn't a
   real form-control, so BS5 doesn't flex it and the trailing button (free-text
   toggle) wraps to a new line. Make it behave like a form-control so the name
   fills the row and the button sits at the right on the same line. */
.input-group > .form-control-plaintext {
	flex: 1 1 auto;
	width: 1%;
	min-width: 0;
}

/* Filter-button count badges: white pill with muted-blue number instead of
   the grey/white default, so they read on the blue buttons. */
.filter_state .badge {
	background-color: #fff !important;
	color: #337ab7 !important;
}

/* Soften BS5's electric-blue primary back to the muted production blue. */
.btn-primary {
	--bs-btn-bg: #337ab7;
	--bs-btn-border-color: #2e6da4;
	--bs-btn-hover-bg: #286090;
	--bs-btn-hover-border-color: #204d74;
	--bs-btn-active-bg: #204d74;
	--bs-btn-active-border-color: #122b40;
	--bs-btn-disabled-bg: #337ab7;
	--bs-btn-disabled-border-color: #2e6da4;
}

/* Link buttons (e.g. "Unohditko salasanan?"): match the primary blue, and
   only underline on hover. */
.btn-link {
	--bs-btn-color: #337ab7;
	--bs-btn-hover-color: #286090;
	text-decoration: none;
}

/* a.btn-link beats the later, equally-specific `.btn:hover` no-underline rule. */
a.btn-link:hover, a.btn-link:focus {
	text-decoration: underline;
}

/* Info buttons (e.g. Varastopuutteet): production cyan with white text. */
.btn-info {
	--bs-btn-bg: #5bc0de;
	--bs-btn-border-color: #46b8da;
	--bs-btn-color: #fff;
	--bs-btn-hover-bg: #31b0d5;
	--bs-btn-hover-border-color: #269abc;
	--bs-btn-hover-color: #fff;
	--bs-btn-active-bg: #269abc;
	--bs-btn-active-color: #fff;
}

/* Warning buttons (Valmis / Lisää / Lataa): muted production orange, white text
   (BS5's default #ffc107/#ffcd39 was too bright). */
.btn-warning {
	--bs-btn-color: #fff;
	--bs-btn-bg: #f0ad4e;
	--bs-btn-border-color: #eea236;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #ec971f;
	--bs-btn-hover-border-color: #d58512;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #ec971f;
	--bs-btn-active-border-color: #d58512;
	--bs-btn-disabled-color: #fff;
	--bs-btn-disabled-bg: #f0ad4e;
	--bs-btn-disabled-border-color: #eea236;
}

/* Success buttons (e.g. active order flag): production green. */
.btn-success {
	--bs-btn-color: #fff;
	--bs-btn-bg: #5cb85c;
	--bs-btn-border-color: #4cae4c;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #449d44;
	--bs-btn-hover-border-color: #398439;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #449d44;
	--bs-btn-active-border-color: #398439;
}

/* Inactive flag buttons: BS3 btn-default look (white, grey border). */
.btn-outline-secondary {
	--bs-btn-color: #333;
	--bs-btn-bg: #fff;
	--bs-btn-border-color: #ccc;
	--bs-btn-hover-color: #333;
	--bs-btn-hover-bg: #e6e6e6;
	--bs-btn-hover-border-color: #adadad;
	--bs-btn-active-color: #333;
	--bs-btn-active-bg: #e6e6e6;
	--bs-btn-active-border-color: #adadad;
}

a {
	color: #337ab7;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* Buttons are often <a>; keep them from picking up the link underline. */
.btn:hover, .btn:focus {
	text-decoration: none;
}

/* Pill tabs (e.g. stock shortage): muted-blue active, cyan idle, grey hover. */
.nav-pills .nav-link {
	color: #5bc0de;
}

.nav-pills .nav-link:hover {
	background-color: #eee;
	text-decoration: none;
}

.nav-pills .nav-link.active {
	background-color: #337ab7;
	color: #fff;
}

/* Card/box titles: production used 16px; BS5's h3 default was too large. */
.card-title {
	font-size: 16px;
}

/* Give stacked cards a little vertical breathing room. */
.card {
	margin-bottom: 1rem;
}

/* Hox box (was BS3 panel-info): soft blue border with a light blue header,
   not BS5's bright cyan border + grey header. */
.card.border-info {
	border-color: #bce8f1 !important;
}

.card.border-info > .card-header {
	color: #31708f;
	background-color: #d9edf7;
	border-bottom-color: #bce8f1;
}

/* Vertically center the card-header title against any action buttons. Toolbars
   are placed in the markup BEFORE the title with .float-end; in a flex header
   float is inert, so push them back to the right with order + auto margin. A
   header with only a title is unaffected (single centered child). */
.card-header {
	display: flex;
	align-items: center;
}

.card-header > .float-end {
	order: 1;
	margin-left: auto;
}

/* Production base font was 14px; BS5 bumped the default to 16px. Bring text,
   tables, links, form controls and buttons back to 14px. */
body {
	font-size: 14px;
}

.form-control,
.form-select,
.input-group-text,
.col-form-label,
.form-label,
.btn {
	font-size: 14px;
}

/* Horizontal-form labels: right-aligned and bold like BS3's control-label. */
.col-form-label {
	text-align: right;
	font-weight: 700;
}

/* Inline add-forms: keep input-groups from stretching full width and pushing
   the submit button onto the next line. */
form.d-flex .input-group {
	width: auto;
}

/* Pagination sits in a text-end column, but a flex .pagination ignores
   text-align; align it to the right and give it room below the header. */
.pagination {
	justify-content: flex-end;
	margin-top: 4px;
	--bs-pagination-color: #337ab7;
	--bs-pagination-hover-color: #286090;
	--bs-pagination-focus-color: #286090;
	--bs-pagination-active-bg: #337ab7;
	--bs-pagination-active-border-color: #337ab7;
	--bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(51, 122, 183, .25);
}

.button-image:before {
    content: "";
	width: 18px;
	height: 18px;
    display: inline-block;
    margin-right: 5px;
    vertical-align: text-top;
    background-color: transparent;
    background-position: center center;
    background-repeat: no-repeat;
	background-size: contain;
}

.button-maventa:before{
     background-image : url(/images/32/maventa-logo.png);
}

.button-fennoa:before{
	background-image : url(/images/32/fennoa-logo.png);
}


/* ============================================================
   Print styles (kept last so they win over the screen rules above)
   ============================================================ */
@media print {

	/* A4 */
	html, body {
		width: 210mm;
		height: 297mm;
		font-size: 12px;
	}

	/* Remove the appended href text from links. */
	a[href]:after {
		content: none !important;
	}

	/* Hide on-screen chrome: nav bar, background image, breadcrumb and the
	   page header (big title + action buttons). Only the cards print. */
	.navbar,
	.navbar-default,
	div.background,
	.breadcrumb,
	.pb-2.mb-4.border-bottom {
		display: none !important;
	}

	/* Use the full paper width: drop the container max-width and the white
	   panel margin/border. Keep default padding so the row's negative margin
	   doesn't pull content off the printable area. */
	.container {
		width: 100% !important;
		max-width: 100% !important;
	}
	section div.container {
		margin: 0 !important;
		border: none !important;
	}

	/* Span the half-width layout cards across the page — but only real layout
	   columns (direct children of a .row), NOT table cells that use col-* for
	   their column widths (those would otherwise all stretch to 100%). */
	.row > [class*="col-md-"] {
		flex: 0 0 100% !important;
		max-width: 100% !important;
		width: 100% !important;
	}

	/* Align label and value on the same baseline (col-form-label has slightly
	   more top padding than form-control-plaintext). */
	.card-body .col-form-label,
	.card-body .form-control-plaintext {
		padding-top: 1px;
		padding-bottom: 1px;
	}

	/* Work order print table: tall rows so quantities can be marked by hand. */
	.d-print-table tbody tr {
		height: 15mm;
	}
	.d-print-table tbody td {
		vertical-align: middle;
	}
}
