@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&display=swap');

:root {
  --star-orange: #f0984a;
  --star-orange-dark: #d97a2e;
  --star-cream: #fbe3a1;
  --star-pink: #f6c6c0;
  --star-green: #7cc7a4;
  --star-blue: #7fb8d9;
  --bg: #fdf6ea;
  --bg-grad: linear-gradient(160deg, #fff9ef 0%, #fdf1dc 55%, #fbe9d3 100%);
  --card-bg: #ffffff;
  --text-main: #4a3a28;
  --text-sub: #a4927a;
  --border-soft: #f2e3c8;
  --shadow-sm: 0 2px 8px rgba(180, 130, 70, 0.10);
  --shadow-md: 0 8px 24px rgba(180, 130, 70, 0.16);
  --shadow-lg: 0 16px 40px rgba(180, 130, 70, 0.20);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
}

a { color: var(--star-orange-dark); text-decoration: none; }

svg.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- Header ---------- */
header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-soft);
}

header.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  white-space: nowrap;
}

header.app-header .brand img { width: 38px; height: 38px; filter: drop-shadow(0 3px 4px rgba(200,140,60,.25)); }

nav.app-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

nav.app-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all .15s ease;
}

nav.app-nav a.active {
  background: linear-gradient(135deg, var(--star-orange), var(--star-orange-dark));
  color: #fff;
  box-shadow: 0 4px 10px rgba(217,122,46,.35);
}

nav.app-nav a:hover:not(.active) { background: var(--star-cream); color: var(--star-orange-dark); }

.user-badge {
  font-size: 0.82rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.user-badge .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--star-cream), var(--star-orange));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 0.85rem;
}

.user-badge button {
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--star-orange-dark);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .15s;
}
.user-badge button:hover { background: var(--star-cream); }

main {
  max-width: 1020px;
  margin: 0 auto;
  padding: 32px 20px 70px;
  animation: fadeIn .35s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
  margin-bottom: 20px;
  border: 1px solid var(--border-soft);
  transition: box-shadow .2s ease;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 34px;
  background: linear-gradient(120deg, #fff 0%, #fff7ea 60%, #ffefd6 100%);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,152,74,.18), transparent 70%);
}
.hero img { width: 104px; height: 104px; filter: drop-shadow(0 6px 10px rgba(200,140,60,.3)); position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; position: relative; z-index: 1; }
.hero p { margin: 0; color: var(--text-sub); position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--star-orange), var(--star-orange-dark));
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(217,122,46,.3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(217,122,46,.4); }
.btn:active { transform: translateY(0); }

.btn.secondary {
  background: var(--star-cream);
  color: var(--text-main);
  box-shadow: none;
}
.btn.secondary:hover { background: #f5dca0; box-shadow: none; }

.btn.ghost {
  background: transparent;
  color: var(--text-sub);
  box-shadow: none;
  border: 1px solid var(--border-soft);
}
.btn.ghost:hover { background: var(--bg); box-shadow: none; }

.btn.danger { background: linear-gradient(135deg, #e08579, #c65b4d); box-shadow: 0 4px 12px rgba(198,91,77,.3); }
.btn.small { padding: 7px 14px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 0.83rem; margin-bottom: 6px; color: var(--text-sub); font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-soft);
  background: #fffdf8;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  transition: border-color .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--star-orange);
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--star-cream);
  color: var(--star-orange-dark);
}
.pill.offline { background: #fbe0dc; color: #b5544a; }
.pill.status-completed { background: #dcf1e6; color: #2f8a5c; }
.pill.status-cancelled { background: #eee; color: #8a8a8a; }
.pill.status-scheduled { background: #dcecf6; color: #3778a0; }
.pill.neutral { background: var(--bg); color: var(--text-sub); }

/* ---------- Lists ---------- */
.list-item {
  padding: 16px 4px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
  border-radius: 10px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fffaf1; }

.item-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.stat-box {
  background: linear-gradient(160deg, #fff, var(--bg));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  transition: transform .15s;
}
.stat-box:hover { transform: translateY(-2px); }
.stat-box .value { font-size: 1.7rem; font-weight: 800; color: var(--star-orange-dark); }
.stat-box .label { font-size: 0.78rem; color: var(--text-sub); margin-top: 4px; }

.bar-track { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 10px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--star-blue), var(--star-orange)); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 44px 10px;
  color: var(--text-sub);
}
.empty-state img { width: 84px; margin-bottom: 12px; opacity: 0.9; }

/* ---------- Loading ---------- */
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--text-sub); padding: 20px 4px; font-size: 0.88rem; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--star-cream); border-top-color: var(--star-orange);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-item {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-soft);
  transition: transform .15s, box-shadow .15s;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--star-cream);
  display: block;
}
.gallery-item .meta-wrap { padding: 10px 12px 14px; }
.gallery-item .title { font-weight: 700; font-size: 0.92rem; }
.gallery-item .meta { font-size: 0.75rem; color: var(--text-sub); margin-top: 3px; }

/* ---------- Forum card list ---------- */
.post-card {
  display: flex;
  gap: 14px;
  padding: 16px 6px;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: background .15s;
}
.post-card:hover { background: #fffaf1; }
.post-card:last-child { border-bottom: none; }
.post-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--star-cream); flex-shrink: 0;
}
.post-thumb-placeholder {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: var(--star-cream); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.post-thumb-placeholder img { width: 34px; height: 34px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--border-soft);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--text-sub);
  transition: all .15s;
}
.tabs button.active { background: linear-gradient(135deg, var(--star-orange), var(--star-orange-dark)); color: white; border-color: transparent; }
.tabs button:hover:not(.active) { background: var(--star-cream); }

/* ---------- Calendar ---------- */
.calendar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-head .month-label { font-weight: 800; font-size: 1.05rem; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-dow {
  text-align: center; font-size: 0.72rem; color: var(--text-sub); padding-bottom: 6px;
}
.calendar-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  transition: background .15s;
  background: var(--bg);
}
.calendar-cell.empty { background: transparent; cursor: default; }
.calendar-cell:hover:not(.empty) { background: var(--star-cream); }
.calendar-cell.today { border: 2px solid var(--star-orange); }
.calendar-cell.selected { background: linear-gradient(135deg, var(--star-orange), var(--star-orange-dark)); color: #fff; }
.calendar-cell .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--star-orange-dark); position: absolute; bottom: 6px; }
.calendar-cell.selected .dot { background: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(74,58,40,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  animation: fadeIn .15s ease;
}
.modal-box {
  background: #fff; border-radius: var(--radius-lg); padding: 26px 28px;
  max-width: 480px; width: 100%; box-shadow: var(--shadow-lg);
  max-height: 88vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 16px; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- Comments ---------- */
.comment { padding: 12px 4px; border-bottom: 1px dashed var(--border-soft); font-size: 0.9rem; }
.comment .author { font-weight: 700; margin-right: 6px; }

/* ---------- Login ---------- */
.login-wrap {
  max-width: 380px;
  margin: 70px auto;
  text-align: center;
}
.login-wrap img { width: 96px; filter: drop-shadow(0 6px 10px rgba(200,140,60,.3)); }
.login-wrap h1 { font-size: 1.3rem; margin: 14px 0 22px; }

.error-text { color: #c0554a; font-size: 0.85rem; margin-top: 10px; }

.section-divider { border: none; border-top: 1px solid var(--border-soft); margin: 22px 0; }

@media (max-width: 640px) {
  header.app-header { flex-wrap: wrap; }
  nav.app-nav { order: 3; width: 100%; justify-content: flex-start; }
  .hero { flex-direction: column; text-align: center; padding: 26px; }
}
