@font-face {
	font-family: 'resavska-regular';
	src: url('../fonts/resavska-regular.woff2') format('woff2');
	font-display: auto;
}

@font-face {
	font-family: 'resavska-bold';
	src: url('../fonts/resavska-bold.woff2') format('woff2');
	font-display: auto;
}

:root {
	--color-main: #243D48;
	--color-cal-attendance-bg: #e2f6d6;
	--color-cal-attendance-text: #4b852a;
	--color-cal-attendance-bg--unfinish: #ffdbea;
	--color-cal-attendance-text--unfinish: #cd467e;
	--color-cal-leave-bg: #d3f4fa;
	--color-cal-leave-text: #108fa8;
	--color-cal-sick-bg: #dbe5ff;
	--color-cal-sick-text: #3b60c5;

	--input-border-color: #8f8f9d;
	--input-login-bg-color: #f2f6f8;
	--input-login-border-color: #e9e9e9;
}

html {
	height: 100%;
}

body {
	margin: 0;
	height: 100%;
	font-family: 'resavska-regular';
}

.button-style {
	--bg-color: #cccc;

	width: auto;
	padding: 10px 14px;
	border: 0;
	border-radius: 8px;
	outline: none;
	color: #fff;
	font-family: 'resavska-bold';
	font-size: 14px;
	background-color: var(--bg-color);
	transition: background-color 150ms ease-out;
}

.button-style:not([data-active]):disabled {
	--bg-color: #dedede;
}

.button-style:hover {
	cursor: pointer;
}

.button-style--green { --bg-color: var(--color-main); }
.button-style--green:hover { --bg-color: #315463; }
.button-style--red { --bg-color: #f33d3c; }
.button-style--red:hover { --bg-color: #ff5555; }
.button-style--grey-light { --bg-color: #999999; }
.button-style--grey-light:hover { --bg-color: #777777; }
.button-style--grey-dark { --bg-color: #777777; }
.button-style--grey-dark:hover { --bg-color: #999999; }

.input-style {
	padding: 8px;
	box-sizing: border-box;
	height: 38px;
	border-radius: 8px;
	border: 1px solid var(--input-border-color);
}

.nonstandard-only.hidden {
	display: none !important;
}

label {
	display: flex;
	align-items: center;
}

dialog {
	border: none;
	width: fit-content;
	min-width: min(440px, 100%);
	max-width: min(640px, 100%);
	padding: 0 20px;
	box-sizing: border-box;
	background: transparent;
	overflow: visible;
}

dialog::backdrop {
	background-color: #0000008f;
}

dialog > div {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding: 25px;
	border: none;
	border-radius: 8px;
	box-shadow: 0 4px 12px 0 #0b0c0e40;
	background-color: #fff;
}

dialog p {
	margin: 0.6rem;
}

dialog input {
	outline: none;
	color: var(--color-main);
	box-sizing: border-box;
}

dialog .content {
	display: grid;
	margin-bottom: 10px;
}

dialog .buttons {
	align-self: flex-end;
	display: flex;
	align-items: stretch;
	justify-content: end;
}

dialog button.button-style {
	position: relative;
	margin-top: 1rem;
}

dialog button.button-style:not(:first-child) {
	margin-left: 4px;
}

dialog#login-modal p {
	margin: 0;
	line-height: 1.15;
}

dialog#login-modal ol {
	margin: 1.2em 0;
	padding: 0;;
	list-style: none;
}

dialog#login-modal li:first-child {
	margin-bottom: 4px;
}

dialog#attendance-modal .content {
	gap: 10px;
	grid-template-columns: max-content auto;
	grid-template-rows: auto auto auto;
	width: 100%;
}

dialog#attendance-modal .content input {
	width: 100%;
}

dialog#attendance-modal .content input[type="date"] {
	width: 100%;
}

dialog#attendance-modal.hide-title .full-date {
	display: none;
}

dialog#attendance-modal.hide-dates input[type="date"] {
	display: none;
}
dialog#attendance-modal.hide-dates label[for="a-from"],
dialog#attendance-modal.hide-dates label[for="a-to"] {
	display: none;
}

dialog#attendance-modal .content .full-date {
	grid-column: 1 / 3;
	margin: 0 0 20px 0;
	text-align: center;
	font-size: 17px;
	font-family: 'resavska-bold';
	color: #777;
}

dialog#attendance-modal .time-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

dialog#attendance-modal .time-wrapper input {
	min-width: 85px;
}

dialog#attendance-modal .time-wrapper > span {
	display: inline-block;
	width: 10px;
	height: 1px;
	margin: 0 10px;
	background-color: #8f8f9d;
}

dialog#attendance-modal label {
	margin: 6px 10px 6px 0;
}

dialog#attendance-modal .comment-wrapper {
	display: flex;
	flex-direction: column;
	align-items: end;
}

dialog#attendance-modal .comment-wrapper textarea {
	width: 100%;
	height: initial;
	resize: vertical;
	outline: none;
}

dialog#attendance-modal .comment-wrapper small {
	color: #999;
  	padding: 0 2px;
	margin-top: 4px;
  	font-size: 13px;
}

dialog#attendance-modal .nonstandard-only label {
	padding-top: 4px;
}

dialog#leave-modal select:disabled {
	border-color: #c7c7ce;
}

dialog button[data-active]:disabled { 
	color: var(--bg-color);
}
dialog button[data-active]:disabled::after {
	content: '';
	position: absolute;
	top: calc(50% - 7px);
	left: calc(50% - 7px);
	width: 14px;
	height: 14px;
	margin-top: -1px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

dialog#leave-modal .content {
	grid-template-columns: auto auto;
	grid-template-rows: auto auto auto auto auto;
	gap: 10px;
	width: 100%;
	margin-bottom: 0px;
}

dialog#leave-modal label {
	margin: 6px 0;
}

dialog#leave-modal select {
	background-color: white;
	border: 1px solid #8f8f9d;
	color: var(--color-main);
}

dialog#leave-modal label[for="nt"] {
	grid-column: 1 / 3;
}

dialog#leave-modal input[name="comment"] {
	grid-column: 1 / 3;
	position: relative;
	top: -8px;
}

dialog#leave-modal small {
	grid-column: 1 / 3;
	text-align: right;
	position: relative;
	top: -14px;
	color: #999;
	padding: 0 2px;
	font-size: 13px;
}

dialog#report-modal .content {
	grid-template-columns: auto auto auto;
	gap: 10px;
	width: 100%;
}

dialog#report-modal select {
	padding: 6px;
	border: 1px solid #8f8f9d;
	color: var(--color-main);
	background-color: white;
}

dialog#report-modal select:disabled {
	border-color: #c7c7ce;
	color: #c7c7ce;
}

dialog#report-modal select[name="report-type"],
dialog#report-modal select[name="employee"] {
	grid-column: span 3;
}

/* Login page */

.login-layout {
	display: flex;
	height: 100%;
	background-color: #f1f1f1;
}

.login-layout__image,
.login-layout__content {
	width: 50%;
	height: 100%;
}

.login-layout__image {
	background: url(../media/login-cover.jpg)  right bottom / cover no-repeat;
}

.login-layout__image img {
	display: block;
	width: 90px;
	margin: 20px;
	opacity: 0.5;
}

.login-layout__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 0 20px;
}

.login-box {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 400px;
	margin: auto auto 20px auto;
	border-radius: 8px;
	box-shadow: 0 4px 12px 0 #0b0c0e40;
	overflow: hidden;
	background-color: #fff;
}

.login-box__logo {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid #e9e9e9;
	background-color: #f7f7f7;
}

.login-box__logo img {
	display: block;
	width: 160px;
}

.login-box__main {
	padding: 20px 32px;
}

.login-box__main__heading {
	text-align: center;
	font-weight: normal;
	color: var(--color-main);
}

.login-form {
	display: flex;
	flex-direction: column;
	padding: 14px 0;
}

.login-form__input-container {
	margin: 4px 0;
}

.login-form__input {
	width: 100%;
	height: 40px;
	padding: 8px 13px;
	border-radius: 8px;
	border-width: 1px;
	border-style: solid;
	border-color: var(--input-login-border-color);
	background-color: var(--input-login-bg-color);
	box-sizing: border-box;
	outline: none;
	transition: border-color 200ms ease-in-out;
}

.login-form__input:focus {
	border-color: var(--color-main);
}

.login-form__input:focus ~ .login-form__input {
	border-color: var(--color-main);
}

.login-form__input:disabled {
	color: #777;
}

.hardcoded-email {
	display: flex;
}

.hardcoded-email__input--start {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	border-right: none;
	padding-right: 0;
	border-color: var(--input-login-border-color);
	background-color: var(--input-login-bg-color);
}

.hardcoded-email__input--end {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	border-left: none;
	padding-left: 0;
	text-align: right;
	color: #777;
	opacity: 1;
	border-color: var(--input-login-border-color);
	background-color: var(--input-login-bg-color);
}

.login-form__submit {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 40px;
	margin: 10px 0 25px 0;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 500;
	background-color: var(--color-main);
	color: #fff;
	font-family: 'resavska-bold';
	transition: background-color 150ms ease-out;
}

.login-form__submit:hover {
	cursor: pointer;
	background-color: #315463;
}

.login-form__submit:disabled {
	color: #ccc;
	background-color: #777;
}

.login-form__submit:disabled::after {
	content: '';
	position: absolute;
	right: 20px;
	display:block;
	height: 17px;
	cursor: auto;
	aspect-ratio: 1 / 1;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

.login-box__footer {
	padding: 10px;
	margin: 0;
	border-top: 1px solid #e9e9e9;
	text-align: center;
	color: var(--color-main);
	background-color: #f7f7f7;
}

.copyright {
	margin: auto 0 20px 0;
	font-size: 14px;
	text-align: center;
	color: #666;
}

@media screen and (max-width: 1100px) {
	.login-layout__image {
		display: none;
	}

	.login-layout__content {
		width: 100%;
	}
}


/* Dashboard page */

.dashboard-layout {
	display: flex;
	height: 100%;
}

.dashboard-layout__side-panel {
	display: flex;
	flex-direction: column;
	width: 17rem;
	padding: 20px;
	box-sizing: border-box;
	background-color: #f1f1f1;
}

.dashboard-layout__side-panel > .logo {
	width: 150px;
	display: block;
	max-width: 100%;
}

.datetime {
	display: flex;
	flex-direction: column;
	padding: 20px 0;
}

.datetime__time {
	margin: 0 0 4px 0;
	text-align: center;
	font-size: 3.2rem;
	color: var(--color-main);
}

.datetime__date {
	margin: 0;
	text-align: center;
	font-size: 1.1rem;
	color: #555;
}

.action {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px 0;
}

.action__button {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 8rem;
	aspect-ratio: 1;
	padding: 0;
	border: 0.4rem solid;
	border-radius: 50%;
	box-sizing: content-box;
	transition: background-color 150ms ease-out;
}

.action__button[data-status="in"] {
	border-color: #d7e5eb;
	background-color: var(--color-main);
}

.action__button[data-status="in"]:hover {
	cursor: pointer;
	background-color: #315463;
}

.action__button[data-status="out"] {
	border-color: #f0d5d5;
	background-color: #e63958;
}

.action__button[data-status="out"]:hover {
	cursor: pointer;
	background-color: #eb6179;
}

.action__button[data-status="disabled"] {
	border-color: #ccc;
	background-color: #ccc;
}

.action__button[data-status="disabled"]:hover {
	background-color: #ccc;
}

.action__button::before {
	content: '';
	display: block;
	width: 1.8rem;
	aspect-ratio: 1;
	background: url(../media/icon_touch.png) no-repeat center center / cover;
}

.action__button::after {
	margin-top: 6px;
	font-size: 1rem;
	font-family: 'resavska-bold';
	color: #fff;
}

.action__button[data-status="in"]::after {
	content: attr(data-value-in);
}

.action__button[data-status="out"]::after {
	content: attr(data-value-out);
}

.action__button[data-status="disabled"]::before {
	width: 2.6rem;
	background-image: url(../media/icon_no-touch.png);
}

.action__button[data-status="disabled"]::after {
	display: none;
}

.status {
	display: flex;
	justify-content: space-between;
	padding: 20px 0;
}

.status__in,
.status__out,
.status__total {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	text-align: center;
	font-size: 1.0rem;
	font-family: 'resavska-bold';
	color: var(--color-main);
}

.status__in::before,
.status__out::before,
.status__total::before {
	content: '';
	display: block;
	width: 1.8rem;
	aspect-ratio: 1;
	margin-bottom: 8px;
	background: no-repeat center center / cover;
}

.status__in::before {
	background-image: url(../media/icon_clock-in.png);
}

.status__out::before {
	background-image: url(../media/icon_clock-out.png);
}

.status__total::before {
	background-image: url(../media/icon_clock.png);
}

.status__in::after,
.status__out::after,
.status__total::after {
	margin-top: 10px;
	font-size: 0.9rem;
	color: #555;
	font-family: 'resavska-regular';
}

.status__in::after {
	content: 'Пријављен';
}

.status__out::after {
	content: 'Одјављен';
}

.status__total::after {
	content: 'Укупно';
}

.general-controls {
	margin-top: 80px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto;
	gap: 8px;
}

.general-controls > button:nth-child(3) {
	grid-column: 1 / 3;
}

.dashboard-layout__main-panel {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	width: auto;
	padding: 0 20px;
	background-color: #fff;
	overflow: auto;
}

.dashboard-layout__main-panel > .header {
	margin: 20px 40px;
	text-align: center;
	font-size: 1.5rem;
	color: var(--color-main);
}

.dashboard-layout__main-panel > #calendar {
	margin: 40px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px 0 #0b0c0e40;
	padding: 20px;
}

/**
 * textColor is not applied to background events
 *
 * @link https://github.com/fullcalendar/fullcalendar/issues/5528
 * @link https://stackoverflow.com/a/78606767
 * @link https://codepen.io/ADyson82/pen/pomWwVv
 */
.fc .fc-bg-event {
	opacity: 1;
	color: #f55;
}

.fc-event:not(.fc-bg-event) {
	cursor: pointer;
}

#logout {
	margin: 20px 0;
}

.user-info {
	color: #777;
	padding: 0 2px;
	font-size: 0.90rem;
	margin: auto 0 20px 0;
}

.user-info > p {
	margin: 2px 0;
}

.password-eye {
	position: relative;
	display: flex;
  	align-items: center;
}

.password-view-btn {
	position: absolute;
  	right: 12px;
	display: block;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	cursor: pointer;
	background-color: transparent;
	background-image: url(../media/eye.svg);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 90%;
}

.password-view-btn::after {
	content: '';
	position: absolute;
	top: 46%;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 4px;
	transform: rotate(45deg);
	background-color: #888;
  	transition: opacity ease 250ms;
  	opacity: 1;
}

#js-password[type="text"] + .password-view-btn::after {
	opacity: 0;
}

.password-eye .login-form__input {
	padding: 8px 50px 8px 13px;
}

@media screen and (max-width: 768px) {
	.button-style {
		padding: 14px;
	}

	.dashboard-layout__side-panel > .logo {
		width: 120px;
	}

	dialog#attendance-modal .content {
		grid-template-columns: auto;
	}

	dialog#attendance-modal .content .full-date {
		grid-column: initial;
	}

	dialog#attendance-modal .nonstandard-only label {
		padding-top: 0;
	}

	dialog#leave-modal .content {
		grid-template-columns: auto;
	}

	dialog#leave-modal input[name="comment"] {
		grid-column: auto;
	}

	dialog#leave-modal small {
		grid-column: auto;
	}

	dialog#report-modal .content {
		grid-template-columns: auto;
		grid-template-rows: auto auto auto;
		margin-left: auto;
		margin-right: auto;
	}

	.dashboard-layout {
		display: block;
	}

	.dashboard-layout__side-panel {
		width: 100%;
		min-height: 100vh;	/* fallback */
		min-height: 100lvh;
	}

	.general-controls {
		margin-top: 40px;
	}

	.status {
		justify-content: space-around;
	}

	.user-info {
		margin: 40px 0 0 0;
	}

	.dashboard-layout__main-panel {
		min-height: 100vh;	/* fallback */
		min-height: 100lvh;
		overflow: visible;
	}

	.dashboard-layout__main-panel > .header {
		margin: 20px 0;
		font-size: 1.3rem;
	}

	.dashboard-layout__main-panel > #calendar {
		margin: 40px 0;
		padding: 10px;
	}

	.fc .fc-toolbar-title {
		font-size: 1.1rem;
	}
}