:root {
  --bg: #f7f5f6;
  --text: #2b2b2b;
  --muted: #6f7b85;
  --primary: #a3d9c9; /* пастельно-мятный */
  --primary-600: #8ccfbd;
  --card: #ffffff;
  --border: #e5e8ec;
  --accent: #eec9d2; /* пастельно-розовый */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Manrope, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  background:
    radial-gradient(1200px 800px at 0% 0%, #f9fafb 0%, rgba(255,255,255,0) 70%),
    radial-gradient(800px 600px at 100% 0%, rgba(163, 217, 201, .25) 0%, rgba(255,255,255,0) 70%),
    radial-gradient(800px 600px at 0% 100%, rgba(238, 201, 210, .22) 0%, rgba(255,255,255,0) 70%),
    var(--bg);
  color: var(--text);
}

.container { width: min(1100px, 92%); margin: 0 auto; }

.admin-header { position: sticky; top:0; background: #fff; border-bottom:1px solid var(--border); z-index: 10; }
.header-inner { display:flex; align-items:center; justify-content:space-between; padding:.75rem 0; }
.brand { font-weight: 700; }

.tabs-container { margin: 1.5rem 0 0; }
.tabs { display:flex; gap:0; border-bottom:2px solid var(--border); background:#fff; border-radius:12px 12px 0 0; overflow:hidden; }
.tab-btn { flex:1; padding:1rem 1.5rem; border:0; background:transparent; cursor:pointer; font-size:1rem; font-weight:600; color: var(--muted); transition:all .2s; position:relative; }
.tab-btn:hover { background:#f9fafb; color: var(--text); }
.tab-btn.active { color: var(--text); background:#fff; }
.tab-btn.active::after { content:''; position:absolute; bottom:-2px; left:0; right:0; height:2px; background: var(--primary); }
.tab-page { display:none; padding-top:1.5rem; }
.tab-page.active { display:block; }
.tab-page .grid { margin-top:0; }

.admin-footer { border-top:1px solid var(--border); padding:1rem 0; margin-top:2rem; color: var(--muted); background:#fff; }

.grid { display:grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border:1px solid var(--border); border-radius: 14px; padding: 1rem; }
.muted { color: var(--muted); }
.error { color: #b00020; margin-top:.5rem; }
.row { display:flex; gap:.75rem; }
.row.center { align-items:center; }
.row.space-between { justify-content: space-between; }

.btn { display:inline-block; padding:.7rem 1rem; border-radius: 12px; border:1px solid var(--border); background:#fff; cursor:pointer; }
.btn.primary { background: var(--primary); border-color: transparent; }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: #fff; }

.segmented { display:inline-flex; gap:0; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:#fff; }
.seg { padding:.5rem .7rem; border:0; background:#fff; cursor:pointer; color:#4b5563; }
.seg.active { background: var(--primary); color:#09332a; }

.form-grid { display:grid; gap:.75rem; }
.form-grid label { display:grid; gap:.25rem; color: var(--muted); font-size:.95rem; }
.form-grid input { padding:.6rem .7rem; border-radius:10px; border:1px solid var(--border); background:#fbfbfb; }

.hours-grid { display:grid; grid-template-columns: 120px repeat(4, 1fr); gap:.5rem; }
.hours-grid-template { display:grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap:.5rem; }
.template-tabs-container { margin-bottom: 1rem; }
.template-tabs { display:flex; gap:0; border-bottom:2px solid var(--border); background:#fff; border-radius:12px 12px 0 0; overflow-x:auto; }
.template-tab-btn { flex:1; min-width:100px; padding:.75rem 1rem; border:0; background:transparent; cursor:pointer; font-size:.9rem; font-weight:600; color: var(--muted); transition:all .2s; position:relative; white-space:nowrap; }
.template-tab-btn:hover { background:#f9fafb; color: var(--text); }
.template-tab-btn.active { color: var(--text); background:#fff; }
.template-tab-btn.active::after { content:''; position:absolute; bottom:-2px; left:0; right:0; height:2px; background: var(--primary); }
.day-col { display:grid; gap:.35rem; }
.day-col.today .day-title { background: #c8e6c9; border-color: var(--primary-600); color: #1b5e20; font-weight: 700; }
.day-title { font-weight:600; padding:.4rem .6rem; background: #fff; border:1px solid var(--border); border-radius:10px; }
.slot { display:flex; flex-direction:column; align-items:flex-start; gap:.25rem; padding:.5rem .6rem; border:1px solid var(--border); border-radius:10px; background:#fff; min-height:60px; }
.slot input { transform: scale(1.1); }
.slot-view { border-color: var(--border); color: #2b2b2b; }
.slot-view.slot-booked { background: #e8f5e9; border-color: var(--primary); }
.slot-view.slot-empty { background: #fff; border-color: var(--border); }
.slot-time { font-weight:600; font-size:.9rem; color: var(--text); }
.slot-client { color: #1368aa; text-decoration:none; font-size:.85rem; }
.slot-client:hover { text-decoration:underline; }
.slot-empty-text { color: var(--muted); font-size:.85rem; font-style:italic; }
.actions { display:flex; gap:.5rem; margin-top: .75rem; }

.schedule-list { display:grid; gap:.5rem; }
.day-block { border:1px solid var(--border); border-radius:12px; background:#fff; }
.day-header { display:flex; align-items:center; justify-content:space-between; padding:.6rem .8rem; border-bottom:1px solid var(--border); background: #fff; }
.day-body { padding:.6rem .8rem; }
.booking-item { display:flex; align-items:center; justify-content:space-between; padding:.4rem 0; border-bottom:1px dashed var(--border); }
.booking-item:last-child { border-bottom:0; }
.contact-link { color:#1368aa; }

.legend { display:flex; gap:.75rem; color: var(--muted); font-size:.9rem; }
.legend .dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:.35rem; vertical-align:middle; }
.legend .workday { background:#cfe8df; }
.legend .weekend { background:#f6d6d6; }
.legend .holiday { background:#f2c38d; }

.calendar { margin: .25rem 0 1rem; border:1px solid var(--border); border-radius:12px; background:#fff; overflow:hidden; }
.cal-header { display:flex; justify-content:space-between; align-items:center; padding:.5rem .75rem; border-bottom:1px solid var(--border); }
.cal-nav { display:flex; gap:.25rem; }
.cal-nav .btn { padding:.35rem .55rem; }
.cal-grid { display:grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { position:relative; padding:.5rem .4rem; border-right:1px solid var(--border); border-bottom:1px solid var(--border); min-height:40px; font-size:.9rem; }
.cal-cell:nth-child(7n) { border-right:0; }
.cal-weekdays { background:#fbfbfb; color:#6b7280; font-weight:600; }
.cal-day { cursor:pointer; }
.cal-day.workday { background:#f9fffc; }
.cal-day.weekend { background:#fff7f7; }
.cal-day.holiday { background:#fff4e6; }
.cal-day.today-cal { background:#c8e6c9 !important; border:2px solid var(--primary-600); }
.cal-day.selected { outline:2px solid var(--primary-600); outline-offset:-2px; }
.count-badge { position:absolute; top:4px; right:4px; font-size:.7rem; padding:.05rem .35rem; border-radius:999px; opacity:.85; }
.count-badge-past { background:#9e9e9e; color:#fff; }
.count-badge-future { background:#4caf50; color:#fff; }

.profit-stats { display:grid; gap:.5rem; }
.profit-item { display:flex; justify-content:space-between; align-items:center; padding:.6rem .8rem; border:1px solid var(--border); border-radius:10px; background:#fff; transition:background .2s; }
.profit-item-clickable:hover { background:#f9fafb; }
.profit-month { font-weight:600; }
.profit-details { display:flex; gap:1rem; align-items:center; }
.profit-count { color: var(--muted); font-size:.9rem; }
.profit-total { font-weight:600; color: var(--primary-600); }
.profit-total-item { display:flex; justify-content:space-between; align-items:center; padding:.75rem 1rem; margin-top:.5rem; border-top:2px solid var(--border); background:#fafafa; border-radius:10px; }

.prices-list { display:grid; gap:.75rem; }
.price-item { padding:.75rem; border:1px solid var(--border); border-radius:10px; background:#fff; position:relative; }
.price-label { font-weight:600; margin-bottom:.5rem; }

/* Кнопка закрытия (удаления типа) */
.close-type { position:absolute; top:8px; right:8px; width:28px; height:28px; border-radius:6px; border:0; background:transparent; color: var(--muted); cursor:pointer; font-weight:700; display:flex; align-items:center; justify-content:center; }
.close-type:hover { background:#f5f5f5; color: var(--text); }

.price-item.dragging { opacity:0.5; border:2px dashed var(--primary-600); }

.price-view-row, .price-edit-row { display:flex; align-items:center; gap:.5rem; }
.price-value { font-size:1.1rem; font-weight:600; color: var(--primary-600); }
.price-input { padding:.4rem .6rem; border-radius:8px; border:1px solid var(--border); width:120px; }
.price-currency { font-weight:600; }
.btn-small { padding:.4rem .6rem; font-size:.9rem; }

.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; z-index:1000; padding:1rem; }
.modal-content { background:#fff; border-radius:14px; max-width:500px; width:100%; max-height:90vh; overflow-y:auto; }
.modal-large { max-width:700px; }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:1rem; border-bottom:1px solid var(--border); }
.modal-header h3 { margin:0; }
.modal-close { background:none; border:0; font-size:24px; cursor:pointer; color: var(--muted); padding:0; width:32px; height:32px; display:flex; align-items:center; justify-content:center; }
.modal-close:hover { color: var(--text); }
.modal-body { padding:1rem; }
.modal-actions { display:flex; gap:.5rem; margin-top:1rem; justify-content:flex-end; }

.chart-legend { display:grid; gap:.5rem; margin-top:1rem; }
.legend-item { display:flex; align-items:center; gap:.5rem; padding:.5rem; background:#f9fafb; border-radius:8px; }
.legend-color { width:20px; height:20px; border-radius:4px; display:inline-block; }
.legend-label { flex:1; font-weight:500; }
.legend-value { font-weight:600; color: var(--primary-600); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .hours-grid { grid-template-columns: 1fr; }
  .profit-details { flex-direction:column; align-items:flex-end; gap:.25rem; }
}


