/* Общие стили */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f8f4f1;
  margin: 0;
  padding: 0;
  color: #543331;
  line-height: 1.45;
}

/* HEADER */
header {
  background: #fff3ee;
  padding: 32px 0 16px 0;
  box-shadow: 0 4px 24px rgba(189,164,152, 0.08);
  text-align: center;
}

header h1 {
  color: #c59d91;
  font-size: 2.5em;
  margin: 0;
  font-weight: 800;
  letter-spacing: 1px;
}

nav {
  background: #fdf7f4;
  padding: 12px 0;
  text-align: center;
  box-shadow: 0 1px 0 #f3e1d7;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

nav a {
  margin: 0 6px;
  color: #b47b7b;
  text-decoration: none;
  padding: 9px 16px;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
}

nav a:hover {
  background: #f4e8e3;
  transform: translateY(-1px);
}

/* SECTIONS */
section {
  max-width: 900px;
  margin: 36px auto;
  background: #fffdfa;
  border-radius: 14px;
  box-shadow: 0 1px 6px #edd9c3;
  padding: 30px 32px 36px;
}

main {
  width: min(1100px, 94%);
  margin: 0 auto;
}

h2 {
  color: #ad7a74;
  margin: 0 0 24px 0;
  font-size: 2em;
  font-weight: 700;
  text-align: center;
}

h3 {
  color: #9c5f7f;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* FEATURES */
.features {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.feature-card {
  flex: 1 1 180px;
  background: #fff5ee;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 1.12em;
  color: #ab088b;
  text-align: center;
  box-shadow: 0 1px 5px #f0e1db;
  font-weight: 500;
}

/* BUTTONS */
.btn {
  display: inline-block;
  background: #e5cfc0;
  color: #8d6760;
  padding: 13px 32px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 17px;
  margin-top: 12px;
  font-weight: 600;
  transition: background 0.17s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(180, 123, 123, 0.16);
}

.btn:hover {
  background: #f1dfd1;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

button,
.main-btn,
.logout-btn,
form button {
  background: #e5cfc0;
  color: #8d6760;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(180, 123, 123, 0.16);
}

button:hover,
.main-btn:hover,
.logout-btn:hover,
form button:hover {
  background: #f1dfd1;
  transform: translateY(-1px);
}

.main-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-button {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.logo {
  color: #c59d91;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.tagline {
  color: #8d6760;
  margin-top: 6px;
  font-size: 1rem;
}

.cabinet-header-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

form,
.record-form,
#loginForm,
#registerForm,
.service-form,
.time-form,
.profile-edit form {
  width: min(560px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-weight: 600;
  color: #7c5550;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e7d3c7;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
  color: #543331;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #d8b4a8;
  box-shadow: 0 0 0 3px rgba(216, 180, 168, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

#servicesContainer,
#servicesList,
#slotsList,
#admin-records,
.profile-section,
.cabinet-section,
#login,
#register,
#record {
  width: min(920px, 100%);
  margin-left: auto;
  margin-right: auto;
}

#servicesList,
#slotsList {
  padding-left: 0;
  list-style: none;
}

#servicesList li,
#slotsList li {
  background: #fff5ee;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #ecd9ce;
}

.admin-delete-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #f0ddd2;
  color: #8d6760;
  font-size: 14px;
  box-shadow: none;
}

.admin-delete-btn:hover {
  background: #e7cfc1;
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.status-badge.is-confirmed {
  background: #dff3e7;
  color: #2f7d4e;
}

.status-badge.is-cancelled {
  background: #fbe3e6;
  color: #a13a45;
}

.status-badge.is-new {
  background: #f3ece6;
  color: #8d6760;
}

.service-card {
  margin: 0 0 18px 0;
}

.service-card-image {
  width: 100%;
  max-width: 420px;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #ecd9ce;
  margin-bottom: 14px;
  display: block;
}

.service-book-btn {
  margin-top: 8px;
}

#register p {
  text-align: center;
}

.available-dates {
  margin: 6px 0 4px;
}

.available-dates-title {
  font-size: 14px;
  color: #8d6760;
  margin-bottom: 8px;
}

.available-dates-empty {
  margin: 0;
  color: #8d6760;
  font-size: 14px;
}

.date-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-chip {
  border: 1px solid #e7d3c7;
  background: #fff5ee;
  color: #8d6760;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.date-chip:hover {
  background: #f1dfd1;
}

.date-chip.is-active {
  background: #e5cfc0;
  border-color: #d8b4a8;
}

.client-base-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr repeat(3, auto);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header-row h2 {
  margin: 0;
}

.toggle-client-base-btn {
  margin-top: 0;
  padding: 10px 18px;
  min-width: 132px;
}

#clientBaseTable {
  font-size: 14px;
}

.table-scroll-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #f1e2d8;
  border-radius: 10px;
}

#clientBaseTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff5ee;
  cursor: pointer;
  user-select: none;
}

#clientBaseTable thead th.sort-active::after {
  margin-left: 6px;
  font-size: 12px;
  color: #8d6760;
}

#clientBaseTable thead th.sort-asc::after {
  content: "▲";
}

#clientBaseTable thead th.sort-desc::after {
  content: "▼";
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1e2d8;
  text-align: left;
}

th {
  background: #fff5ee;
  color: #8d6760;
}

footer,
.site-footer {
  text-align: center;
  color: #8d6760;
  padding: 20px 12px 28px;
}

.site-footer .footer-copy {
  margin: 0 0 8px;
}

.site-footer .footer-legal {
  margin: 0;
  font-size: 14px;
}

.site-footer .footer-legal a {
  color: #9c5f7f;
  text-decoration: underline;
}

.site-footer .footer-legal a:hover {
  color: #7a4a62;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 6px;
  text-align: left;
  font-size: 14px;
  line-height: 1.45;
  color: #5c4a4a;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.form-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-checkbox-label a {
  color: #9c5f7f;
  text-decoration: underline;
}

.policy-section {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.policy-section h2 {
  text-align: center;
}

.policy-section h3 {
  margin-top: 1.4em;
}

.policy-intro,
.policy-date {
  color: #6d5c5c;
}

.mobile-bottom-nav,
.floating-book-btn {
  display: none;
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  section {
    margin: 18px auto;
    padding: 22px 16px;
  }

  .logo {
    font-size: 1.5rem;
  }

  nav a {
    margin: 3px;
    padding: 8px 12px;
    font-size: 14px;
  }

  h2 {
    font-size: 1.65rem;
  }

  .feature-card {
    flex: 1 1 100%;
  }

  .service-card-image {
    max-width: 100%;
    height: 220px;
  }

  .admin-list-item {
    align-items: flex-start;
  }

  .admin-delete-btn {
    padding: 7px 11px;
    font-size: 13px;
  }

  .cabinet-table,
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .service-book-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .client-base-controls {
    grid-template-columns: 1fr 1fr;
  }

  .section-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle-client-base-btn {
    width: 100%;
  }

  button,
  .main-btn,
  .logout-btn,
  form button {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 20px 10px 12px;
  }

  .logo {
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .tagline {
    font-size: 0.9rem;
  }

  main {
    width: 96%;
  }

  section {
    padding: 16px 12px 20px;
    border-radius: 12px;
  }

  nav {
    gap: 6px;
    padding: 8px 6px;
  }

  nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    margin: 0;
  }

  .client-base-controls {
    grid-template-columns: 1fr;
  }

  form,
  .record-form,
  #loginForm,
  #registerForm,
  .service-form,
  .time-form,
  .profile-edit form {
    gap: 10px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    padding: 10px 11px;
  }

  .service-card-image {
    height: 180px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  body {
    padding-bottom: 84px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: rgba(253, 247, 244, 0.97);
    border-top: 1px solid #ecd9ce;
    box-shadow: 0 -4px 14px rgba(189, 164, 152, 0.18);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav a {
    text-decoration: none;
    color: #8d6760;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 8px;
  }

  .mobile-bottom-nav a.is-active {
    background: #f1dfd1;
    color: #7c5550;
  }

  .floating-book-btn {
    position: fixed;
    right: 12px;
    bottom: 92px;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: #e5cfc0;
    color: #8d6760;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(180, 123, 123, 0.28);
  }
}

