﻿/* Кабинет РентаКит — простой и крупный интерфейс для телефона */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8a8a8e);
  --card: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --accent: var(--tg-theme-button-color, #2f7d32);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: #c0392b;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back {
  border: none;
  background: var(--card);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.back.hidden { display: none; }

main { padding: 16px; padding-bottom: 40px; }

.loading, .empty {
  text-align: center;
  color: var(--hint);
  padding: 40px 0;
}

/* карточка объекта */
.card {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 17px;
  cursor: pointer;
}

.card:active { opacity: 0.7; }

.card-title {
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.25;
}

.card-meta {
  display: flex;
  gap: 14px;
  color: var(--hint);
  font-size: 15px;
}

/* прогресс */
.progress {
  height: 8px;
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.2);
  overflow: hidden;
  margin-top: 12px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}

/* этап */
.stage {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 10px;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.stage:active { opacity: 0.7; }

.stage-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.45);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: transparent;
}

.stage-icon.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stage-name { flex: 1; line-height: 1.25; }

.stage-photos { color: var(--hint); font-size: 15px; flex: none; }

.stage.done { opacity: 0.75; }

/* экран этапа */
.hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.hero h2 { margin: 0 0 6px; font-size: 20px; }

.hero p { margin: 0; color: var(--hint); font-size: 15px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--card);
}

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }

.btn-secondary { background: var(--card); color: var(--text); }

.btn:disabled { opacity: 0.45; cursor: default; }

.btn:active:not(:disabled) { transform: scale(0.99); }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 24px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; }

