*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #212529;
	background-color: #f5f7ff;
}

h3, h4, h5 { margin-top: 0; margin-bottom: .5rem; font-weight: 500; line-height: 1.2; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
hr { margin: 10px 0; border: 0; border-top: 1px solid rgba(0,0,0,.1); }
a { color: #007bff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-danger { color: #dc3545; }
.font-weight-bold { font-weight: 700; }
.ws-wrap { white-space: pre-wrap; }
.d-flex { display: flex; }
.flex-fill { flex: 1 1 auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: .5rem; margin-bottom: .5rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; }
.ml-2 { margin-left: .5rem; }
.ml-3 { margin-left: 1rem; }
.mr-3 { margin-right: 1rem; }
.p-2 { padding: .5rem; }
.bg-white { background-color: #fff; }
.border { border: 1px solid #dee2e6; }
.shadow { box-shadow: 0 .5rem 1rem rgba(0,0,0,.15); }
.fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 10; }

/* Grid */
.container { width: 100%; max-width: 1140px; padding: 0 15px; margin: 0 auto; }
.container-fluid { width: 100%; padding: 0 15px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col-sm-6 { width: 100%; padding: 0 15px; }
@media (min-width: 576px) {
	.col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Forms & Buttons */
.form-control {
	display: block;
	width: 100%;
	padding: .375rem .75rem;
	font-size: 1rem;
	font-family: inherit;
	line-height: 1.5;
	color: #495057;
	background-color: #fff;
	border: 1px solid #ced4da;
	border-radius: .25rem;
}
.form-control:disabled { background-color: #e9ecef; opacity: 1; }
textarea.form-control { resize: vertical; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.btn {
	display: inline-block;
	font-family: inherit;
	font-weight: 400;
	text-align: center;
	vertical-align: middle;
	user-select: none;
	border: 1px solid transparent;
	padding: .375rem .75rem;
	font-size: 1rem;
	line-height: 1.5;
	border-radius: .25rem;
	color: #fff;
	cursor: pointer;
}
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn-success { background-color: #28a745; border-color: #28a745; }
.btn-success:hover:not(:disabled) { background-color: #218838; }
.btn-primary { background-color: #007bff; border-color: #007bff; }
.btn-primary:hover:not(:disabled) { background-color: #0069d9; }
.btn-info { background-color: #17a2b8; border-color: #17a2b8; }
.btn-info:hover:not(:disabled) { background-color: #138496; }
.btn-secondary { background-color: #6c757d; border-color: #6c757d; }
.btn-secondary:hover:not(:disabled) { background-color: #5a6268; }
.btn-danger { background-color: #dc3545; border-color: #dc3545; }
.btn-danger:hover:not(:disabled) { background-color: #c82333; }

/* Tables */
.table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.table th, .table td { padding: .75rem; border-top: 1px solid #dee2e6; vertical-align: top; }
.table tr:hover td { background-color: rgba(0,0,0,.04); }

/* Modals */
.modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1050;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.5);
	padding: 1.75rem .5rem;
}
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-dialog { width: 100%; max-width: 500px; margin: auto; }
.modal-content {
	background: #fff;
	border: 1px solid rgba(0,0,0,.2);
	border-radius: .3rem;
	display: flex;
	flex-direction: column;
}
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid #dee2e6;
}
.modal-body { padding: 1rem; max-height: 75vh; overflow-y: auto; }
.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: .5rem;
	padding: .5rem 1rem;
	border-top: 1px solid #dee2e6;
}
.close {
	background: transparent;
	border: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	color: #000;
	opacity: .5;
	cursor: pointer;
	padding: 0;
}
.close:hover { opacity: .8; }

/* App-specific layout */
.login-card {
	display: inline-block;
	padding: 20px 30px;
	border-radius: 10px;
	box-shadow: rgb(200, 210, 255) 0 0 10px;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	background-color: #fff;
}
.login-card input { margin: 8px 0; border-radius: 5px; }
.login-card button { margin: 8px 0; padding: 3px 15px; }

.home-btn { position: fixed; top: 25px; right: 25px; cursor: pointer; z-index: 20; }
.nav-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.nav-button { width: 150px; height: 150px; font-size: 150%; margin: 20px; border-radius: 20px; }
.st-button { width: 400px; max-width: 85vw; height: 70px; font-size: 120%; margin: 20px; border-radius: 20px; }

.ptn-container { text-align: center; padding: 20px 0; }
.name-box-container { display: inline-block; position: relative; }
.ptn-name { width: 500px; max-width: 70vw; display: inline-block; border-radius: 20px; font-size: 150%; font-weight: bold; }
.ptn-btn { margin-bottom: 5px; margin-left: 20px; padding-left: 20px; padding-right: 20px; width: 100px; vertical-align: middle; }
.btn-edit-name { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); height: 30px; padding-top: 2px; }
.auto-complete-box {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	max-height: 300px;
	overflow: auto;
	cursor: pointer;
	z-index: 100;
}
.auto-complete-box > div:hover { background-color: #e9ecef; }

.new-record-col { padding-right: 40px; }
.prev-record-col { padding-left: 40px; }
@media (max-width: 575px) {
	.new-record-col, .prev-record-col { padding-right: 15px; padding-left: 15px; }
}
.prec-input, .note-input { margin-bottom: 20px; }
.fee-input { display: inline-block; max-width: 50%; }
.fee-btn { display: inline-block; width: 45%; margin-bottom: 5px; margin-left: 20px; }

.prev-records-container { height: 420px; overflow-y: auto; padding-right: 20px; }
.prev-record {
	background-color: #fff;
	border: 1px solid #ced4da;
	border-radius: 10px;
	padding: 10px;
	margin-bottom: 20px;
}
.date-btn-container { position: relative; }
.record-datetime { font-weight: bold; padding-right: 150px; }
.edit-btn { position: absolute; right: 80px; top: 0; padding: 1px 10px; }
.delete-btn { position: absolute; right: 0; top: 0; padding: 1px 10px; }
.fee-container { text-align: right; }

.btn-sm { padding: .25rem .6rem; font-size: .875rem; border-radius: .2rem; }
.backup-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: .5rem;
	padding: .6rem 1rem;
	font-weight: 500;
	background-color: #e9ecef;
	color: #495057;
}
.backup-bar.needs-backup { background-color: #fff3cd; color: #856404; border-top: 1px solid #ffeeba; }
