:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6f8;
  --color-text: #1a1a1a;
  --color-text-muted: #5f6470;
  --color-primary: #2454ff;
  --color-primary-dark: #173ecf;
  --color-event: #16a34a;
  --color-border: #e4e6ea;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}

header.topbar .logo { font-weight: 700; font-size: 1.2rem; color: var(--color-primary); }
header.topbar a.admin-link { color: var(--color-text-muted); font-size: 0.9rem; text-decoration: none; }

h1 { font-size: 1.7rem; margin-bottom: 20px; }

.year-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.year-nav button {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
}

.year-nav span { font-size: 1.4rem; font-weight: 700; color: var(--color-primary); min-width: 70px; text-align: center; }

.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.month-card { border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden; }

.month-card h3 {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

table.mini-cal { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
table.mini-cal th { color: var(--color-text-muted); padding: 4px 0; font-weight: 500; }
table.mini-cal td {
  text-align: center;
  padding: 5px 0;
  cursor: default;
}

table.mini-cal td.has-event {
  background: #dcfce7;
  color: var(--color-event);
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
}

table.mini-cal td.has-event:hover { background: var(--color-event); color: #fff; }

.event-list { margin-top: 48px; }

.event-list h2 { font-size: 1.3rem; margin-bottom: 16px; }

.event-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.event-item .date-badge {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 8px 14px;
  text-align: center;
  font-weight: 700;
  min-width: 60px;
}

.event-item .details { flex: 1; }
.event-item .details strong { display: block; font-size: 1.05rem; }
.event-item .details .meta { color: var(--color-text-muted); font-size: 0.88rem; margin-top: 2px; }
.event-item .details p { margin-top: 6px; font-size: 0.92rem; }

.empty-state { color: var(--color-text-muted); text-align: center; padding: 40px 0; }

/* Admin */
.admin-box {
  max-width: 420px;
  margin: 80px auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
}

.admin-box h1 { font-size: 1.3rem; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.88rem; }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
}
.btn:hover { background: var(--color-primary-dark); }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.error-msg { color: #dc2626; font-size: 0.88rem; margin-top: 8px; }

.admin-panel { max-width: 720px; margin: 0 auto; padding: 24px; }
.admin-panel h1 { margin-bottom: 24px; }
.admin-events-list .event-item { align-items: center; }
.admin-events-list .actions { display: flex; gap: 8px; }
.actions button { padding: 6px 12px; font-size: 0.85rem; }