/* Музыкальная школа «Форте» — обновлённый дизайн, прежнее расположение */
:root {
  --paper: #f4f0ea;
  --ink: #2a2520;
  --ink-soft: #5a534c;
  --nav-bg: #1e332c;
  --nav-hover: #2a453c;
  --accent: #b8860b;
  --accent-hover: #9a7209;
  --accent-soft: #e8d5a3;
  --card-bg: #ffffff;
  --border: #ddd6cc;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(42, 37, 32, 0.06);
  --shadow-lg: 0 8px 24px rgba(42, 37, 32, 0.1);
}

* { box-sizing: border-box; }

body {
  font-family: 'Karla', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Верхняя навигация */
.app-nav {
  background: linear-gradient(180deg, var(--nav-bg) 0%, #1a2d26 100%);
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0;
  min-height: 56px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem 0 0;
  color: #fff;
  text-decoration: none;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.app-brand:hover { color: var(--accent-soft); }

.app-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--accent-soft);
}

.app-brand-icon svg {
  flex-shrink: 0;
}

.app-brand:hover .app-brand-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.app-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}

.app-nav-links a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0 1rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
  position: relative;
  border-bottom: 3px solid transparent;
}

.app-nav-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.app-nav-links a.active {
  color: #fff;
  background: rgba(184, 134, 11, 0.2);
  border-bottom-color: var(--accent);
}

.app-nav-links a.active:hover {
  background: rgba(184, 134, 11, 0.28);
}

@media (max-width: 768px) {
  .app-nav-inner {
    min-height: auto;
    padding: 0.6rem 0;
    gap: 0.5rem;
  }
  .app-nav-links a {
    padding: 0.5rem 0.75rem;
    border-bottom: none;
    border-radius: var(--radius-sm);
  }
  .app-nav-links a.active {
    border-bottom: none;
    background: var(--accent);
  }
}

/* Основной контент */
.app-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* Карточки статистики — стиль с верхней полосой */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  border: none;
  transition: box-shadow 0.25s, transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(42, 37, 32, 0.1);
}

.stat-card .stat-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.stat-card.accent {
  background: linear-gradient(180deg, rgba(184, 134, 11, 0.04) 0%, var(--card-bg) 24px);
}

.stat-card.accent .stat-value { color: var(--accent); }

/* Карточки контента — тот же стиль */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.content-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  border: none;
  transition: box-shadow 0.25s;
}

.content-card:hover {
  box-shadow: 0 8px 24px rgba(42, 37, 32, 0.1);
}

.content-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}

.content-card .meta {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.content-card .meta + .meta { margin-top: 0.25rem; }

/* Таблицы — карточка с верхней полосой */
.table-wrap {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  border: none;
  overflow: hidden;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th {
  background: var(--nav-bg);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.875rem 1rem;
  text-align: left;
}

.app-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.app-table tbody tr:last-child td { border-bottom: none; }

.app-table tbody tr:hover { background: rgba(184, 134, 11, 0.08); }

.app-table .muted { color: var(--ink-soft); }

/* Кнопки */
.btn-forte {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.btn-forte:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-outline-forte {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.btn-outline-forte:hover {
  background: var(--accent);
  color: #fff;
}

/* Блок «Ближайшие занятия» */
.upcoming-block {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  border: none;
  overflow: hidden;
}

.upcoming-block .block-header {
  background: var(--nav-bg);
  color: #fff;
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.upcoming-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.upcoming-block li {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upcoming-block li:last-child { border-bottom: none; }

.upcoming-block .lesson-name { font-weight: 600; color: var(--ink); }

.upcoming-block .lesson-meta { font-size: 0.875rem; color: var(--ink-soft); }

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.empty-state a { color: var(--accent); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* Футер */
.app-footer {
  background: var(--nav-bg);
  color: rgba(255, 255, 255, 0.9);
  padding: 1.25rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

.app-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-footer a { color: var(--accent-soft); text-decoration: none; }

.app-footer a:hover { text-decoration: underline; }

/* ========== Страница календаря ========== */
.calendar-page-header {
  margin-bottom: 1.5rem;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.calendar-filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.calendar-filter label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
  white-space: nowrap;
}

.calendar-select {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 220px;
  background: var(--card-bg);
  font-size: 0.9rem;
  color: var(--ink);
}

.calendar-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}

.calendar-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar-btn-add-icon {
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 300;
}

.calendar-wrap {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  border: none;
  overflow: hidden;
}

/* FullCalendar — переопределения под стиль «Форте» */
.fc {
  --fc-border-color: var(--border);
  --fc-button-bg-color: var(--nav-bg);
  --fc-button-border-color: var(--nav-bg);
  --fc-button-hover-bg-color: var(--nav-hover);
  --fc-button-hover-border-color: var(--nav-hover);
  --fc-button-active-bg-color: var(--accent);
  --fc-button-active-border-color: var(--accent);
  --fc-today-bg-color: rgba(184, 134, 11, 0.08);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--paper);
  font-family: inherit;
}

.fc .fc-toolbar {
  padding: 0 0 1.25rem 0;
  margin: 0 0 1rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.fc .fc-button {
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
}

.fc .fc-button:focus {
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.3);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent);
  border-color: var(--accent);
}

.fc .fc-button-primary:hover {
  background: var(--nav-hover);
  border-color: var(--nav-hover);
}

.fc .fc-col-header-cell {
  padding: 0.6rem 0.25rem;
  background: var(--paper);
}

.fc .fc-col-header-cell-cushion {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
}

.fc .fc-daygrid-day {
  transition: background 0.15s;
}

.fc .fc-daygrid-day:hover {
  background: rgba(184, 134, 11, 0.04);
}

.fc .fc-daygrid-day-number {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 50%;
  margin: 0.35rem;
  text-decoration: none;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--accent);
  color: #fff;
}

.fc .fc-daygrid-day.fc-day-today {
  background: var(--fc-today-bg-color);
}

.fc .fc-daygrid-day-frame {
  min-height: 6rem;
}

.fc .fc-scrollgrid {
  border: none;
}

.fc .fc-scrollgrid td,
.fc .fc-scrollgrid th {
  border-color: var(--border);
}

.fc .fc-daygrid-event {
  margin: 0 2px 2px 2px;
  border-radius: 6px;
  border: none;
  padding: 0.2rem 0.4rem;
}

.fc .fc-daygrid-event .fc-event-main {
  font-size: 0.8rem;
  font-weight: 500;
}

.fc .fc-event-title {
  font-weight: 500;
}

.fc .fc-daygrid-event-harness {
  margin: 0 2px;
}

.fc .fc-daygrid-event-harness .fc-daygrid-event {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Неделя и список */
.fc .fc-timegrid-slot {
  height: 2.5rem;
}

.fc .fc-timegrid-axis-cushion {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.fc .fc-list-event:hover td {
  background: rgba(184, 134, 11, 0.06);
}

.fc .fc-list-event-dot {
  border-color: var(--accent);
}

.fc .fc-list-day-cushion {
  background: var(--paper);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
}

/* Модальное окно */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-lg); }

.modal-header {
  background: var(--nav-bg);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1rem 1.25rem;
}

.modal-header .modal-title { font-weight: 600; font-family: 'Fraunces', Georgia, serif; }

.modal-body { padding: 1.25rem; }

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

.stat-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--ink); }

.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 0.5rem; }

/* ========== Главная страница — индивидуальный блок ========== */
.home-hero {
  background: linear-gradient(135deg, var(--nav-bg) 0%, #2a453c 100%);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 0.8;
}

.home-hero-inner { position: relative; z-index: 1; }

.home-hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-soft);
  margin-bottom: 0.35rem;
}

.home-hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem 0;
  letter-spacing: 0.02em;
}

.home-hero-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* Статистика на главной: 3 компактные + 1 широкая */
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.4fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .home-stats { grid-template-columns: 1fr; }
}

.home-stat {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.2rem 1.25rem;
  border: none;
  text-align: center;
  color: var(--ink);
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  transition: box-shadow 0.25s, transform 0.2s;
}

.home-stat:hover {
  box-shadow: 0 8px 24px rgba(42, 37, 32, 0.1);
  transform: translateY(-3px);
}

.home-stat-icon {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.home-stat-icon svg {
  display: block;
  margin: 0 auto;
}

.home-stat-num {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.home-stat-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.home-stat-main {
  grid-column: span 1;
  background: linear-gradient(180deg, rgba(184, 134, 11, 0.08) 0%, var(--card-bg) 30px);
}

.home-stat-main .home-stat-num { color: var(--accent); font-size: 2rem; }

@media (max-width: 992px) {
  .home-stat-main { grid-column: span 2; }
}

@media (max-width: 576px) {
  .home-stat-main { grid-column: span 1; }
}

/* Быстрые действия на главной */
.home-quick {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.35rem;
  border: none;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  transition: box-shadow 0.25s;
}

.home-quick:hover {
  box-shadow: 0 4px 16px rgba(42, 37, 32, 0.08);
}

.home-quick-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1rem 0;
}

.home-quick-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 0.5rem;
  border: none;
  cursor: pointer;
}

.home-quick-btn:last-child { margin-bottom: 0; }

.home-quick-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-quick-btn-icon svg {
  flex-shrink: 0;
}

.home-quick-btn-primary {
  background: var(--accent);
  color: #fff;
}

.home-quick-btn-primary:hover { background: var(--accent-hover); color: #fff; }

.home-quick-btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--border);
}

.home-quick-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Ближайшие занятия на главной — дата слева */
.home-upcoming {
  background: var(--card-bg);
  border-radius: 14px;
  border: none;
  box-shadow: 0 2px 12px rgba(42, 37, 32, 0.06);
  overflow: hidden;
}

.home-upcoming-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--nav-bg);
  color: #fff;
}

.home-upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-upcoming-list li {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.home-upcoming-list li:last-child { border-bottom: none; }

.home-upcoming-date {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  line-height: 1;
}

.home-upcoming-body {
  flex: 1;
  min-width: 0;
}

.home-upcoming-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.home-upcoming-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.home-upcoming-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.home-upcoming-empty a { color: var(--accent); text-decoration: none; }
.home-upcoming-empty a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .app-nav .container { flex-direction: column; align-items: stretch; }
  .app-nav-links { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
