/* ═══════════════════════════════════════════════
   Les Tambours d'Eckmuhl — Custom Styles
   ═══════════════════════════════════════════════ */

:root {
  --brand: #d35400;
  --brand-dark: #a04000;
  --brand-light: #e8a77f;
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --sidebar-width: 260px;
  --header-height: 60px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ═══ LOGIN PAGE ═══ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: linear-gradient(135deg, #2c3e50 0%, #d35400 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.login-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 0.25rem;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.15);
}

.login-form button[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.login-form button[type="submit"]:hover {
  background: var(--brand-dark);
}

.login-error {
  background: #ffeaea;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.login-footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ═══ APP HEADER ═══ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1.25rem;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon { font-size: 1.5rem; }

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.user-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: rgba(0,0,0,0.06);
}

.back-link {
  font-size: 0.9rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

/* ═══ APP LAYOUT ═══ */

.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* ═══ SIDEBAR ═══ */

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.15s;
}

.category-item:hover {
  background: rgba(0,0,0,0.04);
}

.category-item.active {
  background: rgba(211, 84, 0, 0.1);
  color: var(--brand);
  font-weight: 600;
}

.cat-icon { font-size: 1.1rem; }

.cat-name { flex: 1; }

.cat-count {
  font-size: 0.75rem;
  background: rgba(0,0,0,0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  color: var(--text-muted);
  min-width: 1.5rem;
  text-align: center;
}

.category-item.active .cat-count {
  background: rgba(211, 84, 0, 0.15);
  color: var(--brand);
}

/* Sidebar events widget */
.sidebar-events {
  margin-top: 1rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-events-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.sidebar-event-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.sidebar-event-item:hover { background: rgba(0,0,0,0.04); }

.sei-date {
  font-size: 0.7rem;
  color: var(--brand);
  font-weight: 600;
  min-width: 65px;
}

.sei-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sei-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-event-more {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--brand);
  text-decoration: none;
  padding: 0.3rem;
}

.sidebar-events-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

.empty-state-sm {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══ MAIN CONTENT ═══ */

.main-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  min-width: 0;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--brand);
  outline: none;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.toolbar-actions select {
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: white;
}

.btn-primary {
  padding: 0.6rem 1.2rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary {
  padding: 0.6rem 1.2rem;
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

/* ═══ UPLOAD ZONE ═══ */

.upload-zone {
  margin-bottom: 1.25rem;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.upload-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 1rem;
}

.upload-drop:hover,
.upload-drop.drag-over {
  border-color: var(--brand);
  background: rgba(211, 84, 0, 0.03);
}

.drop-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.drop-content p {
  margin: 0.25rem 0;
  color: var(--text);
}

.drop-hint {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
}

.upload-options {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-options select,
.upload-options input {
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.upload-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.85rem;
  gap: 0.5rem;
}

.upload-file-item span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.upload-progress {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.upload-progress progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  border: none;
  background: var(--bg);
}

.upload-progress progress::-webkit-progress-bar {
  background: var(--bg);
  border-radius: 4px;
}

.upload-progress progress::-webkit-progress-value {
  background: var(--brand);
  border-radius: 4px;
}

.upload-progress progress::-moz-progress-bar {
  background: var(--brand);
  border-radius: 4px;
}

/* ═══ FILE LIST ═══ */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s;
}

.file-card:hover {
  border-color: var(--brand-light);
  box-shadow: 0 2px 8px rgba(211, 84, 0, 0.08);
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.file-sep { opacity: 0.4; }

.file-desc {
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.file-actions .btn-icon {
  font-size: 1.1rem;
  padding: 0.35rem;
}

/* ═══ EMPTY STATE ═══ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.empty-hint { font-size: 0.85rem; }

/* ═══ LOADING ═══ */

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* ═══ MEDIA MODAL ═══ */

.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: var(--text-muted);
}

.modal-close:hover {
  background: rgba(0,0,0,0.06);
}

.modal-body {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: auto;
  max-height: 70vh;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

.player-audio {
  width: 100%;
  text-align: center;
  padding: 2rem 1rem;
}

.audio-icon { font-size: 3rem; margin-bottom: 1rem; }

.preview-unavailable {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.preview-icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* ═══ ADMIN ═══ */

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.admin-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-form h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--brand);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.user-inactive { opacity: 0.5; }

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

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin { background: rgba(211, 84, 0, 0.1); color: var(--brand); }
.badge-member { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.badge-active { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.badge-inactive { background: rgba(231, 76, 60, 0.1); color: var(--danger); }

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}

.actions-cell {
  display: flex;
  gap: 0.25rem;
}

/* ═══ STATS ═══ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ═══ TOAST ═══ */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  max-width: 90vw;
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--text); color: white; }

/* ═══ RESPONSIVE ═══ */

@media (max-width: 768px) {
  .hamburger {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
  }

  .hamburger:hover { background: rgba(0,0,0,0.06); }

  .brand-name { display: none; }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - var(--header-height));
    z-index: 200;
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(-105%);
    background: white;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    padding: 0.75rem;
  }

  .toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .search-box { min-width: unset; width: 100%; }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .file-card {
    padding: 0.65rem 0.75rem;
  }

  .file-meta {
    font-size: 0.75rem;
  }

  .file-desc { display: none; }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    overflow-x: auto;
  }

  .tab-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .user-info { display: none; }

  .modal-body {
    max-height: 60vh;
  }

  .media-modal {
    width: 95%;
  }

  .upload-drop {
    padding: 1.25rem;
  }

  .drop-icon { font-size: 2rem; }
}

@media (max-width: 480px) {
  .login-container {
    padding: 1.5rem 1.25rem;
  }

  .login-logo { font-size: 3rem; }

  .login-header h1 { font-size: 1.25rem; }

  .stat-card {
    padding: 1rem;
  }

  .stat-value { font-size: 1.5rem; }
}

/* ═══ INVITES ═══ */

.invite-link-box {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.invite-link-box input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--brand);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: monospace;
  background: rgba(211, 84, 0, 0.03);
}

.invite-link-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.invite-result {
  border-color: var(--brand-light);
  background: rgba(211, 84, 0, 0.02);
}

.badge-pending {
  background: rgba(243, 156, 18, 0.15);
  color: var(--warning);
}

.invite-info {
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(211, 84, 0, 0.05);
  border-radius: 8px;
}

/* ═══ CALENDAR ═══ */

.calendar-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cal-month-title {
  font-size: 1.3rem;
  margin: 0;
  min-width: 180px;
  text-align: center;
}

.cal-prev, .cal-next {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  user-select: none;
  color: var(--brand);
  font-weight: 700;
  transition: background 0.15s;
}

.cal-prev:hover, .cal-next:hover {
  background: rgba(211, 84, 0, 0.1);
}

.cal-today-btn { font-size: 0.8rem; padding: 0.4rem 0.8rem; }

.cal-grid {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cal-header span {
  text-align: center;
  padding: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.cal-day:hover { background: rgba(0,0,0,0.03); }

.cal-day-empty { cursor: default; }
.cal-day-empty:hover { background: none; }

.cal-day-num {
  font-size: 0.9rem;
  font-weight: 500;
}

.cal-day-today {
  background: rgba(211, 84, 0, 0.08);
  border-radius: 8px;
}

.cal-day-today .cal-day-num {
  color: var(--brand);
  font-weight: 700;
}

.cal-day-has-event { background: rgba(39, 174, 96, 0.06); }
.cal-day-has-event:hover { background: rgba(39, 174, 96, 0.12); }

.cal-day-dot {
  font-size: 0.6rem;
  background: var(--brand);
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* Event list */
.event-list h3 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.event-card {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.event-card:hover {
  border-color: var(--brand-light);
}

.event-card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0.15rem;
  background: rgba(211, 84, 0, 0.06);
  border-radius: 6px;
}

.ecd-day { font-size: 0.6rem; text-transform: uppercase; color: var(--text-muted); }
.ecd-num { font-size: 1.1rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.ecd-month { font-size: 0.55rem; text-transform: uppercase; color: var(--text-muted); }

.event-card-info { flex: 1; min-width: 0; }

.event-card-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

.event-card-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Event detail overlay */
.event-detail-overlay, .event-form-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.event-detail, .event-form {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.event-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.event-detail-header h3 { margin: 0; font-size: 1.1rem; }

.event-detail-body { padding: 1.25rem; }

.event-meta-detail p { margin: 0.3rem 0; font-size: 0.9rem; }

.event-description-detail { margin: 0.75rem 0; font-size: 0.9rem; color: var(--text-muted); }

.event-rsvp { margin: 1rem 0; padding: 0.75rem; background: var(--bg); border-radius: 10px; }
.event-rsvp p { margin: 0 0 0.5rem; font-size: 0.9rem; }

.rsvp-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.rsvp-btn {
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.rsvp-btn:hover { border-color: var(--brand-light); }
.rsvp-btn.active { border-color: var(--brand); background: rgba(211, 84, 0, 0.06); font-weight: 600; }

.event-attendees { margin-top: 1rem; }
.event-attendees h4 { font-size: 0.9rem; margin: 0 0 0.5rem; }

.att-group { margin-bottom: 0.5rem; }
.att-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.att-name {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border-radius: 12px;
  font-size: 0.8rem;
  margin: 0.1rem 0.2rem;
}

.event-detail-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Event form */
.event-form {
  padding: 1.5rem;
}

.event-form h3 { margin: 0 0 1rem; font-size: 1.1rem; }

.event-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.event-form input, .event-form textarea, .event-form select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.event-form input:focus, .event-form textarea:focus {
  border-color: var(--brand);
  outline: none;
}

.form-row { display: flex; gap: 0.75rem; }
.form-row label { flex: 1; }

@media (max-width: 768px) {
  .cal-day-num { font-size: 0.8rem; }
  .cal-month-title { font-size: 1.1rem; min-width: unset; }
  .cal-nav { gap: 0.4rem; }
  .event-card { padding: 0.65rem; }
  .event-detail, .event-form { max-width: 95%; }
  .rsvp-btn { padding: 0.4rem 0.65rem; font-size: 0.8rem; }
}

