:root {
  --bg: #f3f6ff;
  --panel: #ffffff;
  --panel-2: #eff3ff;
  --primary: #4f46e5;
  --primary-strong: #3730a3;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 20px 45px rgba(79, 70, 229, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #f5f4ff 0%, #eff6ff 25%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 2vw, 2.3rem);
}

.primary-btn,
.ghost-btn,
.filter-btn,
.task-toggle {
  border: none;
  border-radius: 12px;
  transition: 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.25);
  font-weight: 600;
  padding: 0.9rem 1.25rem;
}

.primary-btn:hover,
.ghost-btn:hover,
.filter-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary-strong);
  padding: 0.7rem 0.9rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.05);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  border-radius: 18px 18px 0 0;
}

.accent-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.accent-purple::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.accent-gold::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.accent-green::before { background: linear-gradient(90deg, #10b981, #34d399); }

.stat-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.stat-card small {
  color: var(--muted);
}

.main-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.planner-panel,
.workspace-panel,
.insights-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.small-gap {
  margin-bottom: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background: #eef2ff;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.filter-btn.active {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary-strong);
}

#event-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row {
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
}

input,
select,
textarea {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.submit-btn {
  margin-top: 4px;
  width: 100%;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.04);
}

.event-card.selected {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.12);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.event-card-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.event-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-planning {
  color: #9a5b00;
  background: rgba(245, 158, 11, 0.12);
}

.badge-confirmed {
  color: #0c7c58;
  background: rgba(16, 185, 129, 0.12);
}

.badge-completed {
  color: #3545d1;
  background: rgba(79, 70, 229, 0.12);
}

.event-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.event-progress {
  width: 100%;
  height: 8px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.muted-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary-strong);
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f8fafc;
}

.task-item.done .task-label {
  text-decoration: line-through;
  color: var(--muted);
}

.task-toggle {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(79, 70, 229, 0.5);
  background: white;
  position: relative;
}

.task-item.done .task-toggle {
  background: linear-gradient(135deg, var(--success), #6ee7b7);
  border-color: transparent;
}

.task-item.done .task-toggle::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-label {
  flex: 1;
  font-size: 0.88rem;
}

.empty-state {
  padding: 22px 18px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.04);
  text-align: center;
}

@media (max-width: 1100px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .planner-panel,
  .workspace-panel,
  .insights-panel {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .topbar,
  .panel-head,
  .event-card-header,
  .event-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-inline: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    width: 100%;
  }
}

.small-btn {
  width: 100%;
  margin-top: 0;
}

.template-wrap {
  display: flex;
  align-items: end;
  gap: 12px;
  width: 100%;
}

.template-wrap label {
  flex: 1;
}

.template-wrap .small-btn {
  margin-bottom: 0;
  white-space: nowrap;
}

.small-btn {
  width: auto;
  min-width: 150px;
}

.view-panel.hidden {
  display: none;
}

.landing-shell {
  display: grid;
  gap: 22px;
  padding-top: 8px;
}

.landing-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px 24px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(79, 70, 229, 0.1);
}

.landing-copy {
  max-width: 600px;
}

.landing-copy h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 8px 0 12px;
}

.landing-copy p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.accent {
  color: var(--primary-strong);
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.landing-event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.landing-event-item {
  background: linear-gradient(180deg, #ffffff, #f8f9ff);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-event-item h3 {
  font-size: 1.05rem;
}

.landing-event-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.landing-event-item .ghost-btn {
  margin-top: auto;
}

.small-btn {
  width: 100%;
}

.template-wrap {
  display: flex;
  align-items: end;
}

@media (max-width: 760px) {
  .landing-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-actions {
    width: 100%;
  }

  .landing-actions button {
    flex: 1;
  }
}

.detail-header {
  margin-bottom: 18px;
}

.detail-page {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.detail-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.detail-summary {
  grid-column: 1 / -1;
}

.detail-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary-strong);
  font-weight: 700;
  margin-bottom: 18px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.detail-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.detail-card textarea {
  width: 100%;
  margin-top: 10px;
}

.detail-head {
  margin-bottom: 12px;
}

#detail-task-list {
  margin-top: 8px;
}

#detail-notes {
  min-height: 180px;
}

@media (max-width: 900px) {
  .detail-page {
    grid-template-columns: 1fr;
  }

  .detail-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }
}

.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.budget-summary-card {
  grid-column: 1 / -1;
}

.budget-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.budget-box {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.budget-box span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.budget-box strong {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.budget-card {
  grid-column: 1 / -1;
}

.budget-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.budget-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row !important;
  font-weight: 600;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.budget-table-wrap {
  overflow-x: auto;
}

.budget-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.budget-table th,
.budget-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: middle;
}

.budget-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.budget-entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.budget-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

@media (max-width: 760px) {
  .budget-overview-grid {
    grid-template-columns: 1fr;
  }
}

.budget-status-wrap {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
}

.budget-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.budget-status-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.budget-status-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), #63d6a9);
  width: 0%;
  transition: width 0.2s ease;
}

.budget-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-table td input[type="number"],
.budget-table td input[type="text"] {
  width: 100%;
  min-width: 110px;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
}

.budget-table td input[type="checkbox"] {
  accent-color: var(--primary);
}

.budget-status-bar.over-budget .budget-status-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.people-panel {
  max-width: 1400px;
  margin: 24px auto 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.people-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 16px;
}

.people-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.person-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}

.person-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.person-details strong {
  font-size: 1rem;
}

.person-details span,
.person-details small {
  color: var(--muted);
  font-size: 0.8rem;
}

.role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.role-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8f9ff);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.role-card h3 {
  font-size: 1.05rem;
}

.role-card-head span,
.role-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.role-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.role-assigned-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.role-assignment-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.role-assignment-form select {
  flex: 1;
  min-width: 120px;
}

.volunteer-card {
  grid-column: 1 / -1;
}

.document-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.document-form label {
  flex: 1;
  min-width: 200px;
}

.document-form input[type="file"] {
  padding: 8px 12px;
  font-size: 14px;
}

.documents-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8f9ff);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  font-size: 14px;
}

.document-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.document-filename {
  font-weight: 600;
  color: #1e293b;
}

.document-meta {
  font-size: 12px;
  color: #64748b;
}

.document-actions {
  display: flex;
  gap: 8px;
}

.document-actions button {
  padding: 6px 12px;
  font-size: 12px;
}
