/* ============================================
   ТЕБЕ МОЖНО — Main CSS
   Colors: Beige #F5EDD8 | Sage #8FA890 | White #FFFFFF
   Font: Montserrat (UI) + Cormorant Garamond (logo)
   ============================================ */

:root {
  --bg:            #F5EDD8;
  --bg-deep:       #EDE0C4;
  --surface:       #FDFAF4;
  --surface-2:     #F7F0E3;
  --primary:       #8FA890;
  --primary-light: #B8CCB9;
  --primary-pale:  #E8EFE8;
  --primary-dark:  #6F8A72;
  --accent:        #A7BBA8;
  --text:          #2A1F0E;
  --text-2:        #6B5240;
  --text-3:        #9B8A78;
  --border:        #E0CEB0;
  --border-light:  #EDE0C4;
  --white:         #FFFFFF;
  --error:         #C0392B;
  --success:       #27AE60;
  --warning:       #E67E22;
  --shadow-sm:     0 1px 4px rgba(42,31,14,.07);
  --shadow-md:     0 4px 16px rgba(42,31,14,.10);
  --shadow-lg:     0 10px 32px rgba(42,31,14,.13);
  --shadow-xl:     0 20px 60px rgba(42,31,14,.16);
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-2xl: 40px;
  --r-full:9999px;
  --ease:  cubic-bezier(.4,0,.2,1);
  --fast:  150ms;
  --base:  260ms;
  --slow:  450ms;
  --header-h: 72px;
  --mobile-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* Глушим rubber-band/bounce при доскролле до краёв страницы на мобильных */
  overscroll-behavior: none;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior: none;
  padding-top: var(--header-h);
  padding-bottom: 0;
}

body.mobile { padding-bottom: var(--mobile-nav-h); }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-pale); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(253,250,244,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  transition: box-shadow var(--base) var(--ease);
}
.header.scrolled { box-shadow: var(--shadow-md); }

.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
}

/* Logo — текст «тебе · можно» с зелёной точкой */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  transition: opacity var(--fast) var(--ease);
}
.logo:hover { opacity: .85; }
.logo__name {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--text-2);
  line-height: 1;
}
.logo__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: block;
}
@media (max-width: 768px) {
  .logo__name { font-size: 1.35rem; }
  .logo__dot { width: 7px; height: 7px; }
  .logo { gap: 9px; }
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav__link i { font-size: 1.05rem; }
.nav__link:hover { background: var(--bg-deep); color: var(--primary); }
.nav__link.active { background: var(--primary); color: var(--white); }

/* Header actions */
.header__actions { margin-left: auto; flex-shrink: 0; }
.header__auth { display: flex; gap: 10px; align-items: center; }

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-pale);
  background: var(--bg-deep);
}
.user-menu__name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   MOBILE NAV
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: rgba(253,250,244,.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}
.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
  position: relative;
  min-width: 52px;
}
.mobile-nav__item i { font-size: 1.35rem; }
.mobile-nav__item.active { color: var(--primary); }
.mobile-nav__item .badge {
  position: absolute;
  top: 4px; right: 8px;
  min-width: 18px; height: 18px;
  background: var(--error);
  color: var(--white);
  border-radius: var(--r-full);
  font-size: .6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main { min-height: calc(100vh - var(--header-h)); position: relative; z-index: 1; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-full);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  white-space: nowrap;
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(61,107,79,.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-deep); color: var(--text); }

.btn-surface {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-surface:hover:not(:disabled) { background: var(--bg-deep); border-color: var(--primary-pale); }

.btn-danger { background: var(--error); color: var(--white); border-color: var(--error); }
.btn-danger:hover:not(:disabled) { background: #A93226; }

.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: .8rem; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow var(--base) var(--ease), transform var(--base) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card__body { padding: 20px; }
.card__header { padding: 20px 20px 0; }
.card__footer { padding: 0 20px 20px; }

/* ============================================
   FORMS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.form-input {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61,107,79,.12);
}
.form-input::placeholder { color: var(--text-3); font-weight: 400; }
.form-input.error { border-color: var(--error); }
.form-error { font-size: .8rem; color: var(--error); font-weight: 500; }

textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.5; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B5240' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================
   RATING STARS
   ============================================ */
.stars {
  display: inline-flex;
  gap: 2px;
  color: #F0A500;
  font-size: .9rem;
}
.stars .empty { color: var(--border); }

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-deep);
  flex-shrink: 0;
}
.avatar-placeholder {
  border-radius: 50%;
  background: var(--primary-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-xs { width: 28px; height: 28px; font-size: .75rem; }
.avatar-sm { width: 36px; height: 36px; font-size: .875rem; }
.avatar-md { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-xl { width: 100px; height: 100px; font-size: 2rem; }
.avatar-2xl { width: 140px; height: 140px; font-size: 2.5rem; }

/* ============================================
   BADGE / TAGS
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 600;
  background: var(--primary-pale);
  color: var(--primary-dark);
  white-space: nowrap;
}
.tag-sm { padding: 3px 8px; font-size: .7rem; }
.tag-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.tag-outline.selected, .tag-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(61,107,79,.07); }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42,31,14,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--base) var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transform: scale(.96) translateY(10px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
}
.modal.active { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }

.modal__content {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 36px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: background var(--fast), color var(--fast);
}
.modal__close:hover { background: var(--border); color: var(--text); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 90px; right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  max-width: 340px;
  pointer-events: all;
  animation: toastIn var(--base) var(--ease) forwards;
}
.toast.out { animation: toastOut var(--base) var(--ease) forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--error); }
.toast-info    { border-left: 4px solid var(--primary); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast__icon { font-size: 1.2rem; }
.toast-success .toast__icon { color: var(--success); }
.toast-error .toast__icon   { color: var(--error); }
.toast-info .toast__icon    { color: var(--primary); }
.toast-warning .toast__icon { color: var(--warning); }

@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(20px); } }

/* ============================================
   LOADER / SPINNER
   ============================================ */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--primary-pale);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ============================================
   SECTION LAYOUT
   ============================================ */
.section { padding: 80px 24px; }
.section-sm { padding: 48px 24px; }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }
.container-sm { max-width: 760px; margin: 0 auto; width: 100%; }

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.section-title span { color: var(--primary); }
.section-subtitle {
  font-size: 1rem;
  color: var(--text-2);
  font-weight: 400;
  line-height: 1.7;
  margin-top: 12px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.flex-col { display: flex; flex-direction: column; gap: 16px; }
.flex-row { display: flex; gap: 16px; align-items: center; }

/* ============================================
   UTILITY
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.text-primary { color: var(--primary); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border-light); margin: 24px 0; }

/* Online indicator */
.online-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
  flex-shrink: 0;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 600;
}
.status-pending  { background: #FEF3CD; color: #856404; }
.status-paid     { background: #D1E7DD; color: #0F5132; }
.status-active   { background: #CCE5FF; color: #004085; }
.status-completed{ background: #D1E7DD; color: #0F5132; }
.status-cancelled{ background: #F8D7DA; color: #721C24; }
.status-approved { background: #D1E7DD; color: #0F5132; }
.status-rejected { background: #F8D7DA; color: #721C24; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
}
.empty-state__icon {
  font-size: 3.5rem;
  color: var(--primary-pale);
}
.empty-state__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.empty-state__text { color: var(--text-2); font-size: .9rem; max-width: 320px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
  body { padding-bottom: var(--mobile-nav-h); }
  .mobile-nav { display: flex; }
  .nav { display: none; }
  .header__auth { display: none; }
  .user-menu__name { display: none; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 48px 16px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .modal__content { padding: 24px 20px; border-radius: var(--r-lg); }
  .toast-container { top: 80px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  :root { --header-h: 60px; }
  .logo__name { font-size: 1.2rem; }
  .logo__dot { width: 6px; height: 6px; }
  .logo { gap: 8px; }
}
