/* Базовая раскладка страницы */
* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	background: #1a1a1a;
	color: #fff;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Корень Vue (#app) = flex-контейнер на весь экран */
.layout-root {
	display: flex;
	flex-direction: row;
	width: 100vw;
	height: 100vh;
	overflow: hidden; /* чтобы не было полосы снизу от карты */
}

/* Левая часть (70%) */
.left-pane {
	position: relative;
	flex: 0 0 70%;
	height: 100%;
	background: #000; /* fallback фон пока карта не загрузилась */
}

/* Правая часть (30%) */
.right-pane {
	flex: 0 0 30%;
	height: 100%;
	background: #222;
	border-left: 1px solid #333;
	display: flex;
	flex-direction: column;
	color: #fff;
}

/* Карта Leaflet занимает весь левый блок */
#map {
	width: 100%;
	height: 100%;
}

/* Кнопка "+" для добавления новой машины на карту */
.fab {
	position: absolute;
	right: 16px;
	bottom: 16px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #ffcc00;
	color: #000;
	font-size: 28px;
	line-height: 48px;
	text-align: center;
	font-weight: bold;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,.6);
	user-select: none;
	transition: all .15s;
	border: 0;
}
.fab.active {
	background: #ff5252;
	color: #fff;
}

/* Контейнер контента справа (карточка / форма / плейсхолдер) */
.scrollable-panel {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}

/* Общий вид панели (карточка машины, форма, плейсхолдер) */
.card,
.form-box,
.placeholder-panel {
	background: #2a2a2a;
	border-radius: 8px;
	border: 1px solid #3a3a3a;
	box-shadow: 0 8px 24px rgba(0,0,0,.7);
	padding: 16px;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

/* Заголовок машины */
.car-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 12px;
	color: #fff;
	word-break: break-word;
}

/* Фото машины (главное фото в карточке) */
.main-photo img,
.photo-preview img,
.preview-img {
	max-width: 100%;
	border-radius: 6px;
	display: block;
	margin-bottom: 12px;
	border: 1px solid #444;
	background: #000;
	object-fit: cover;
}

/* Сетка маленьких фоток (если будет массив photos) */
.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 6px;
}
.photo-grid img {
	width: 100%;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #444;
	background: #000;
}

/* Инфостроки внутри карточки */
.row-line {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	padding: 4px 0;
	border-bottom: 1px solid #333;
}
.row-line .label {
	color: #888;
	margin-right: 6px;
	white-space: nowrap;
}
.row-line .value {
	color: #fff;
	text-align: right;
	word-break: break-word;
	max-width: 60%;
}
.break-all {
	word-break: break-all;
}

/* Блоки с описанием / логами */
.row-block {
	margin-top: 12px;
	font-size: 14px;
}
.row-block .label {
	color: #888;
	font-weight: 500;
	margin-bottom: 4px;
}
.row-block .value {
	color: #fff;
	white-space: pre-wrap;
	word-break: break-word;
}
.pre-wrap {
	white-space: pre-wrap;
	word-break: break-word;
	color: #fff;
}

/* История комментариев */
.log-item {
	background: #1f1f1f;
	border: 1px solid #333;
	border-radius: 4px;
	padding: 6px 8px;
	font-size: 13px;
	color: #ccc;
	margin-bottom: 6px;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Кнопки действий под карточкой */
.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}
.btn {
	background: #444;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
	line-height: 1.3;
	color: #fff;
	cursor: pointer;
	user-select: none;
	border: 1px solid #555;
}
.btn:hover {
	background: #555;
}
.btn-danger {
	background: #a00000;
	border-color: #b00000;
}

/* Форма добавления / редактирования */
.form-box h3 {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	margin-bottom: 12px;
}

label {
	display: block;
	font-size: 13px;
	color: #bbb;
	margin-top: 10px;
	margin-bottom: 4px;
}

input,
textarea,
select {
	width: 100%;
	background: #1f1f1f;
	border: 1px solid #444;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 14px;
	color: #fff;
	outline: none;
}
input:focus,
textarea:focus,
select:focus {
	border-color: #888;
}

/* Ряды формы (2 колонки) */
.form-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}
.form-row .col {
	flex: 1;
	min-width: 0;
}

/* Кнопки в форме */
.form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0;
}

/* Превью фото в форме */
.photo-preview {
	margin-top: 12px;
}
.photo-preview img {
	max-width: 100%;
	border-radius: 6px;
	border: 1px solid #444;
	background: #000;
}

/* Заглушка справа, когда ничего не выбрано */
.placeholder-text {
	color: #888;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	padding-top: 40px;
}
.panel-header {
	padding: 12px;
	border-bottom: 1px solid #333;
	display: flex;
	justify-content: flex-end;
	background: #2a2a2a;
}

.btn-add {
	background: #ffcc00;
	color: #000;
	font-weight: 600;
	border-radius: 6px;
	padding: 8px 14px;
	cursor: pointer;
	border: none;
	transition: 0.15s;
}
.btn-add:hover {
	background: #ffdb4d;
}

.log-item {
	position: relative;
	background: #1f1f1f;
	border: 1px solid #333;
	border-radius: 4px;
	padding: 6px 8px;
	font-size: 13px;
	color: #ccc;
	margin-bottom: 6px;
	white-space: pre-wrap;
	word-break: break-word;
	transition: background 0.2s ease;
}

.log-item:hover {
	background: #2a2a2a;
}

.log-date {
	position: absolute;
	right: 8px;
	top: 4px;
	font-size: 11px;
	color: #777;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.log-item:hover .log-date {
	opacity: 1;
}
.info-text {
	padding: 8px;
	color: #555;
	font-style: italic;
	font-size: 14px;
	text-align: center;
}


.map-marker {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #000;
	box-shadow: 0 0 8px rgba(0,0,0,.6);
	transform: translate(-50%, -50%);
}

.map-marker.meeting {
	border-radius: 6px; /* пусть встреча будет квадратнее */
	width: 26px;
	height: 26px;
}

.status-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.status-group-buttons,
.status-level-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.btn.small {
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 6px;
	background: #eee;
	cursor: pointer;
}

.btn.small.active {
	background: #4b6cff;
	color: #fff;
	font-weight: 600;
}

.btn.tiny.circle {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 12px;
	line-height: 28px;
	text-align: center;
	background: #ddd;
	cursor: pointer;
	border: none;
	padding: 0;
}

.btn.tiny.circle.active {
	background: #4b6cff;
	color: #fff;
	font-weight: 600;
}
