:root {
  --blue: #0b78b8;
  --blue-dark: #07598a;
  --blue-soft: #eaf5fb;
  --red: #ed2b2a;
  --red-soft: #fff1f1;
  --bg: #f5f8fb;
  --card: #ffffff;
  --border: #dde7f0;
  --text: #1f2a37;
  --muted: #6b7280;
  --green: #047857;
  --green-soft: #ecfdf5;
  --yellow: #fff7cc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

h1, h2 {
  margin: 0;
  color: var(--text);
}

h1 { font-size: 26px; }
h2 { font-size: 20px; }

p {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.4;
}

.employeeBox {
  display: grid;
  gap: 6px;
  min-width: 250px;
}

.employeeBox label,
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid #c7d7ee;
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 120, 184, 0.12);
}

.layout {
  width: min(1440px, calc(100% - 32px));
  margin: 18px auto 36px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 44, 84, 0.04);
}

.panelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.headActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reserveForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field small {
  color: var(--muted);
  line-height: 1.35;
}

.full { grid-column: 1 / -1; }

.formActions,
.dialogActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.primary:hover { background: var(--blue-dark); }

.secondary {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid var(--border);
}

.danger {
  background: var(--red);
  color: #fff;
}

.rulesBox {
  background: #fffdf5;
  border: 1px solid #f8e7a3;
  color: #5f4b00;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  background: #fff;
  color: var(--blue-dark);
  border: 1px solid var(--border);
}

.tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.searchRow {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.searchRow input { flex: 1; }

.resultsInfo {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.reservesList {
  display: grid;
  gap: 12px;
}

.reserveCard {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.reserveCard.assigned {
  background: #fbfdff;
  opacity: 0.82;
}

.reserveTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.city {
  font-size: 18px;
  font-weight: 900;
  color: var(--blue-dark);
}

.date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.product {
  font-size: 15px;
  line-height: 1.45;
}

.metaGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.metaBox {
  background: #f8fbff;
  border: 1px solid #e4eefb;
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 0;
}

.metaLabel {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 3px;
}

.metaValue {
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.comment {
  color: #334155;
  background: #fffdf5;
  border: 1px solid #f8e7a3;
  border-radius: 12px;
  padding: 10px;
  line-height: 1.4;
  white-space: pre-line;
}

.cardActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cardActions button {
  padding: 9px 12px;
  font-size: 13px;
}

.mark {
  background: var(--yellow);
  border-radius: 5px;
  padding: 1px 3px;
  font-weight: inherit;
}

.statusBadge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.statusActive {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #a7f3d0;
}

.statusAssigned {
  background: var(--red-soft);
  color: #b42318;
  border: 1px solid #fecaca;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.logPanel { margin-bottom: 30px; }

.logList {
  display: grid;
  gap: 8px;
}

.logItem {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdff;
  font-size: 13px;
  line-height: 1.35;
}

.logItem b { color: var(--blue-dark); }

.editDialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(560px, calc(100% - 32px));
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.editDialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.editDialog form {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.24);
  font-weight: 700;
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .reserveForm,
  .metaGrid {
    grid-template-columns: 1fr;
  }

  .searchRow,
  .panelHead {
    flex-direction: column;
  }

  .headActions {
    justify-content: flex-start;
  }
}


/* ===== v1.3: подсказки городов ===== */
.cityField {
  position: relative;
}

.citySuggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  padding: 6px;
  max-height: 240px;
  overflow: auto;
}

.citySuggestItem {
  width: 100%;
  display: block;
  text-align: left;
  background: #ffffff;
  color: var(--text);
  border: 0;
  border-radius: 10px;
  padding: 10px 11px;
  font-weight: 800;
  cursor: pointer;
}

.citySuggestItem:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
