/* ===== PORTAL — uses FreeSpiritOS design tokens from theme.css ===== */

/* ---- Layout ---- */
.portal-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  background: var(--bg-deep);
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.portal-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--sand);
  text-decoration: none;
}

.portal-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.portal-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.portal-links a:hover,
.portal-links a.active {
  color: var(--sand);
  border-color: var(--accent);
}

.portal-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-xl) var(--space-lg);
}

/* ---- Page Header ---- */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--fg);
  margin-bottom: var(--space-xs);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--fg-light);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-light);
  border: 1px solid var(--sand);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: #c0624f;
  color: white;
}

.btn-danger:hover {
  background: #a84e3c;
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-warm);
  border-radius: 8px;
  padding: var(--space-md);
  border: 1px solid var(--sand);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
}

.stat-value.money {
  color: var(--sage);
}

/* ---- Section ---- */
.section {
  margin-bottom: var(--space-xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--fg);
}

/* ---- Cards ---- */
.card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: var(--space-md);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(44, 36, 33, 0.08);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.card-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-radius: 6px;
  background: var(--bg-warm);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.card-list-item:hover {
  border-color: var(--accent-soft);
}

.card-list-info {
  flex: 1;
}

.card-list-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.95rem;
}

.card-list-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.card-list-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

.badge-vinyasa_flow { background: #e8ddd0; color: #6b5e57; }
.badge-private_coaching { background: #dbb896; color: #2c2421; }
.badge-sound_healing { background: rgba(138,154,123,0.15); color: #5a6b4e; }
.badge-meditation { background: rgba(196,149,106,0.15); color: #8a6542; }
.badge-scheduled { background: var(--sage-soft); color: #5a6b4e; }
.badge-completed { background: #e8ddd0; color: #6b5e57; }
.badge-cancelled { background: #f0e0da; color: #a84e3c; }

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sand);
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-warm);
  border-bottom: 1px solid var(--sand);
}

.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--fg);
  border-bottom: 1px solid #f0ebe5;
  vertical-align: middle;
}

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

.data-table tr:hover td { background: var(--bg-warm); }

.data-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-light);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--sand);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--fg);
  background: white;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 33, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal {
  background: white;
  border-radius: 10px;
  padding: var(--space-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover { color: var(--fg); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ---- Calendar ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--sand);
  border: 1px solid var(--sand);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-header-cell {
  background: var(--bg-warm);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.calendar-cell {
  background: white;
  min-height: 100px;
  padding: 0.5rem;
  position: relative;
}

.calendar-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}

.calendar-cell.today .calendar-date {
  background: var(--accent);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-session {
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-vinyasa_flow { background: #e8ddd0; color: #6b5e57; }
.cal-private_coaching { background: #dbb896; color: #2c2421; }
.cal-sound_healing { background: var(--sage-soft); color: #5a6b4e; }
.cal-meditation { background: var(--accent-glow); color: #8a6542; }

/* ---- Empty States ---- */
.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--fg-muted);
}

.empty-state p {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-nav { flex-direction: column; height: auto; padding: var(--space-sm) 0; gap: var(--space-sm); }
  .portal-links { flex-wrap: wrap; justify-content: center; }
  .calendar-cell { min-height: 60px; }
  .data-table { font-size: 0.8rem; }
}