html,
body {
	padding: 0;
	height: 100%;
	font-family: 'Roboto', sans-serif;
	font-size: 13px;
}

body {
	width: 960px;
	margin: 0 auto;
}

#login,
#loading {
	height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.error {
	padding: 5px;
	margin: 5px 0 10px 0;
	color: white;
	background-color: red;
	border-radius: 2px;
}

hr {
    border: 1px solid #eee;
    margin: 10px 0;
}

#login form a {
	color: #666;
	font-weight: 500;
	text-decoration: none;
}

#login form a:hover {
	text-decoration: underline;
}

#login form input {
	padding: 5px;
	border: 1px solid #ccc;
	border-radius: 2px;
}

#login form input[type='submit'] {
	font-weight: bold;
	border-radius: 2px;
	text-align: center;
	background-color: #24a20b;
	border: 1px solid #1d8009;
	color: #fff;
	cursor: pointer;
	padding: 5px 20px;
}

#login form input[type='submit']:disabled {
	background-color: #666;
	border: 1px solid #666;
	cursor: not-allowed;
}

#header {
	display: flex;
	align-items: baseline;
	justify-items: center;
	flex-direction: row;
	justify-content: space-between;
	background-color: #eee;
	box-shadow: 0 1px 7px 0 #cecece;
	margin: 10px 0;
	padding: 5px;
	border-radius: 2px;
	border: 1px solid #d2d2d2;
}

#header .title a {
	color: inherit;
	text-decoration: none;
}

#title {
	font-size: 16px;
	font-weight: 500;
	text-align: center;
	padding: 15px;
	background-color: #f9f9f9;
}

#menu {
	background-color: #eee;
	margin-bottom: 10px;
}

#menu a {
	color: inherit;
	text-decoration: none;
	font-weight: 500;
	display: inline-block;
	padding: 5px;
	margin: 0 5px;
}

#menu a.active {
	background-color: #fff;
	box-shadow: 0 -7px 7px -7px #cecece;
}

#menu a:hover {
	text-decoration: underline;
}

/** ------------------------- Home ------------------------------------------ */

#home table {
	width: 100%;
}

#home table tr td {
	padding: 5px;
}

#home table thead tr {
	background-color: #666;
	color: #fff;
}

#home table tbody tr:nth-child(odd) {
	background-color: #eee;
}

#home table tbody tr:hover {
	background-color: #ddd;
}

/** ------------------------- Detail ---------------------------------------- */

#detail {
}

#detail img {
	max-width: 150px;
}

#detail .empty-logo,
#detail .info-logo {
	font-style: italic;
	color: #666;
}

#detail input[type='url'] {
	width: 20em;
}

#detail table tr td {
	padding: 5px;
}

/** ------------------------- Ads ---------------------------------------- */

#ads {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#ads .ad {
	padding: 10px;
	border: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

#ads .ad img {
	width: 150px;
	height: auto;
	margin-bottom: 10px;
}

#ads .ad .ad-action {
	margin-top: 10px;
}

#ads .ad .ad-action a {
	color: #333;
}

#ad-new {

}

/** ------------------------- Map ------------------------------------------- */

#map {
	position: relative;
	height: calc(100vh - 180px);
}

#map-canvas {
	width: 100%;
	height: 100%;
	background: #f9f9f9;
}

#map .error {
	position: absolute;
	top: 5px;
	left: 232px;
	right: 5px;
	display: flex;
	flex-direction: row;
}

#map .error .ico a {
	color: white;
}

#map .error .message {
	flex-grow: 1;
}

#map .menu,
#map .edit {
	display: flex;
	flex-direction: column;
	position: absolute;
	left: 16px;
	top: 16px;
	bottom: 32px;
	width: 200px;
	border-radius: 2px;
	border: 1px solid #d2d2d2;
	background: #fff;
}

#map .menu .items,
#map .edit .fields {
	flex-grow: 1;
	overflow-y: auto;
}

#map .menu .item {
	display: flex;
	justify-content: space-evenly;
	flex-direction: column;
	margin: 5px; /** margin-left is computed in JS */
	padding: 5px;
}

#map .menu .item:not(:last-child) {
	border-bottom: 1px solid #d2d2d2;
}

#map .menu .item .title-wrapper {
	display: flex;
}

#map .menu .item .title-wrapper .warning {
	margin: 0 5px;
	flex-shrink: 0;
}

#map .menu .item .title-wrapper .title {
	flex-grow: 1;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

#map .menu .item .title-wrapper .ss {
	margin-left: 5px;
	flex-shrink: 0;
	font-weight: 400;
	font-size: 12px;
	padding: 1px;
	border-radius: 2px;
	color: white;
}

#map .menu .item .actions {
	display: flex;
	align-items: baseline;
}

#map .menu .item .actions .space {
	flex-grow: 1;
}

#map .menu .item .actions a {
	color: #333;
	margin-right: 5px;
	padding: 5px;
	border-radius: 2px;
	flex-shrink: 0;
}

#map .menu .item .actions a:first-child {
	margin-left: -5px;
}

#map .menu .item .actions a:hover {
	background: #eee;
}

#map .menu .add {
	flex-shrink: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	height: 30px;
	padding: 5px;
}

#map .menu .add a {
	color: #333;
	text-decoration: none;
}

#map .menu .add a > *:first-child {
	margin-right: 5px;
}

#map .menu .add a:hover {
	text-decoration: underline;
}

#map .menu .import {
	display: flex;
	justify-content: space-evenly;
	flex-direction: column;
	flex-shrink: 0;
	height: 60px;
	padding: 5px;
	border-bottom: 1px solid #d2d2d2;
	background: #eee;
}

#map .menu .import input {
	margin-top: 5px;
}

#map .menu .save {
	display: flex;
	justify-content: center;
	flex-direction: column;
	flex-shrink: 0;
	padding: 5px;
	background: #eee;
	text-align: center;
}

#map .menu .save > * + * {
	margin-top: 5px;
}

#map .menu .save .remove {
	background-color: red;
	border: 1px solid darkred;
}

#map .edit .buttons {
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	flex-direction: row;
	flex-shrink: 0;
	height: 50px;
	padding: 5px;
	background: #eee;
}

#map .edit .buttons input + input {
	margin-left: 5px;
}

#map .menu input[type='submit'],
#map .edit .buttons input[type='submit'] {
	color: white;
	padding: 5px;
	cursor: pointer;
	background-color: #24a20b;
	border: 1px solid #1d8009;
	border-radius: 2px;
}

#map .edit .buttons input[type='submit'] {
	flex-grow: 1.2;
}

#map .edit .buttons input[type='button'] {
	flex-grow: 0.8;
}

#map .edit .buttons input[type='button'] {
	color: white;
	padding: 5px;
	cursor: pointer;
	background-color: #666;
	border: 1px solid #333;
	border-radius: 2px;
}

#map .menu input[type='submit']:disabled,
#map .edit .buttons input[type='submit']:disabled {
	background-color: #666;
	border: 1px solid #666;
	cursor: not-allowed;
}

#map .edit .fields {
	display: flex;
	flex-direction: column;
	padding: 5px;
	overflow: hidden;
}

#map .edit .fields .separator {
	height: 1px;
	margin: 5px 0;
	border-top: 1px solid #d2d2d2;
}

#map .edit .fields .label {
	margin: 5px 0;
}

#map .edit .fields .value {
	display: flex;
	flex-direction: column;
	margin: 5px 0 10px 0;
}

#map .edit .fields .value.self-start {
	align-self: self-start;
}

#map .edit .fields .value.color {
	flex-direction: row;
	justify-content: space-evenly;
}

#map .edit .fields .value.color > * {
	width: 16px;
	height: 16px;
	border-radius: 8px;
	cursor: pointer;
}

#map .edit .fields .value.color .active {
	box-shadow: 1px 1px 10px 1px #525252;
}

#map .color0 {
	background: #666;
}

#map .color1 {
	background: #0047a9;
}

#map .color2 {
	background: #dc0909;
}

#map .color3 {
	background: #109617;
}

/** ------------------------- Info ------------------------------------------ */

#info table {
	width: 100%;
}

#info table tr td {
	padding: 5px;
}

#info table thead tr {
	background-color: #666;
	color: #fff;
}

#info table tbody tr:nth-child(odd) {
	background-color: #eee;
}

#info table tbody tr:hover {
	background-color: #ddd;
}

#add {
	margin: 5px 0 15px;
	padding: 5px;
	background-color: #eee;
	border-radius: 2px;
	border: 1px solid #ddd;
}

#add input,
#add textarea {
	padding: 3px;
	border: 1px solid #ccc;
	border-radius: 2px;
}

#add input[type='submit'] {
	color: white;
	padding: 5px;
	cursor: pointer;
	background-color: #24a20b;
	border: 1px solid #1d8009;
	border-radius: 2px;
}

#add input[type='submit']:disabled {
	background-color: #666;
	border: 1px solid #666;
}

#add input[type='button'] {
	color: #000;
	padding: 5px;
	cursor: pointer;
	background-color: #fff;
	border: 1px solid #666;
	border-radius: 2px;
}

.rally-video {
	display: flex;
	flex-direction: row;
	margin: 5px 0;
}

.rally-video img {
	width: 233px;
	height: 130px;
}

.rally-video .desc {
	flex-grow: 1;
	margin-left: 5px;
}

.rally-video .desc > div {
	margin-bottom: 5px;
}

.rally-video .desc .name {
	display: inline-block;
	width: 7em;
	color: #666;
}

.rally-video button {
	color: white;
	padding: 5px;
	cursor: pointer;
	background-color: red;
	border: 1px solid red;
	border-radius: 2px;
}

.rally-video button:disabled {
	background-color: #666;
	border: 1px solid #666;
	cursor: not-allowed;
}

/** ------------------------- Tracking -------------------------------------- */

#tracking form input {
	padding: 5px;
	border: 1px solid #ccc;
	border-radius: 2px;
}

#tracking form input[type='submit'] {
	font-weight: bold;
	border-radius: 2px;
	text-align: center;
	color: #fff;
	cursor: pointer;
	padding: 5px 20px;
}

#tracking form input.start {
	background-color: #24a20b;
	border: 1px solid #1d8009;
	margin-left: 10px;
}

#tracking form input.stop {
	background-color: red;
	border: 1px solid darkred;
}

#tracking span.saving {
	margin-left: 10px;
}

#tracking span.running {
	color: #24a20b;
	font-weight: bold;
}

#tracking span.stopped {
	color: red;
	font-weight: bold;
}

#tracking-data {
	margin-top: 10px;
}

#tracking-data table {
	width: 100%;
}

#tracking-data table tr td {
	padding: 5px;
}

#tracking-data table thead tr {
	background-color: #666;
	color: #fff;
}

#tracking-data table tbody tr:nth-child(odd) {
	background-color: #eee;
}

#tracking-data table tbody tr:hover {
	background-color: #ddd;
}

