:root {
  --bg: #f7f2e8;
  --card: #fffaf0;
  --ink: #101010;
  --muted: #6f665a;
  --line: #e2d4bf;
  --green: #17a75b;
  --yellow: #f2c94c;
  --orange: #f2994a;
  --red: #eb5757;
  --navy: #091225;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,.13);
}
.login-card p,
.topbar p,
.calendar-head p {
  margin: 0 0 6px;
  color: #d23535;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
}
.login-card h1,
.topbar h1,
.calendar-head h2 { margin: 0; }
.alert {
  background: #ffe0e5;
  color: #9d1020;
  padding: 10px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 800;
}
button,
.topbar a,
.calendar-nav a,
.detail-actions a {
  border: 0;
  border-radius: 11px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  padding: 10px 13px;
  font-weight: 900;
  cursor: pointer;
  font: 900 14px Arial, sans-serif;
}
.topbar {
  min-height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
}
.topbar nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.calendar-page {
  display: grid;
  gap: 18px;
  padding: 18px;
}
.calendar-shell,
.mail-log {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.calendar-head,
.section-title,
.detail-title,
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.calendar-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.legend span {
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  padding: 6px 10px;
  color: #111;
}
.legend .green { background: #dff6e8; }
.legend .yellow { background: #fff3bd; }
.legend .orange { background: #ffe2c2; }
.legend .red { background: #ffd8de; }
.legend .muted { background: #ece5db; color: var(--muted); }
.months-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.months-grid.one-month {
  grid-template-columns: 1fr;
}
.month-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
}
.month-card h3 {
  margin: 0 0 12px;
  font-size: 24px;
}
.weekdays,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.day-cell {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 9px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
  position: relative;
}
button.day-cell { cursor: pointer; }
.empty-day {
  border: 0;
  background: transparent;
}
.day-cell.today {
  box-shadow: inset 0 0 0 2px var(--navy);
}
.day-cell.has-events {
  border-width: 2px;
}
.day-cell.green { border-color: var(--green); }
.day-cell.yellow { border-color: var(--yellow); }
.day-cell.orange { border-color: var(--orange); }
.day-cell.red { border-color: var(--red); }
.day-cell.ignored {
  opacity: .55;
  filter: grayscale(.7);
}
.day-number {
  font-weight: 900;
  font-size: 18px;
}
.event-count {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.day-event-title {
  display: block;
  border-radius: 8px;
  background: #f7f2e8;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty {
  color: var(--muted);
  font-weight: 800;
}
.log-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 12px;
  margin-top: 8px;
}
.log-row span {
  color: var(--muted);
  font-weight: 800;
}
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(9,18,37,.52);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-panel {
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 90px rgba(0,0,0,.25);
}
.form-modal { width: min(760px, 96vw); }
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.detail-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.detail-title p,
.detail-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 900;
}
.detail-title h2,
.detail-event h3 {
  margin: 0;
}
.detail-event {
  border: 1px solid var(--line);
  border-left: 8px solid transparent;
  border-radius: 14px;
  background: var(--card);
  padding: 14px;
  margin-top: 12px;
}
.detail-event.green { border-left-color: var(--green); }
.detail-event.yellow { border-left-color: var(--yellow); }
.detail-event.orange { border-left-color: var(--orange); }
.detail-event.red { border-left-color: var(--red); }
.detail-event.ignored {
  opacity: .6;
  filter: grayscale(.7);
}
.detail-event h4 {
  margin: 14px 0 5px;
}
.detail-event p {
  margin: 0;
  color: #3d362f;
}
.detail-event ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.detail-event li {
  margin: 5px 0;
}
.detail-actions,
.buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.detail-actions form { margin: 0; }
.danger { background: #be1e2d; }
label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  font-size: 13px;
  margin: 11px 0;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  background: #fff;
  font: 600 14px Arial, sans-serif;
}
textarea {
  min-height: 86px;
  resize: vertical;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f2e8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.checks input { width: auto; }
.social-suggestion {
  margin-top: 18px;
  border: 1px solid #c9def4;
  border-radius: 14px;
  background: #f7fbff;
  padding: 14px;
}
.social-suggestion > p {
  margin: 0 0 4px;
  color: #0b4f8a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.social-suggestion h3 {
  margin: 0 0 6px;
}
.social-suggestion small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 12px;
}
.social-suggestion strong {
  display: block;
  margin-top: 12px;
}
.social-suggestion ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.social-suggestion li { margin: 5px 0; }
@media (max-width: 900px) {
  .topbar,
  .calendar-head,
  .detail-title,
  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .weekdays,
  .days-grid {
    gap: 5px;
  }
  .day-cell {
    min-height: 86px;
    padding: 7px;
  }
}
@media (max-width: 620px) {
  .calendar-page { padding: 10px; }
  .calendar-shell,
  .mail-log,
  .month-card {
    border-radius: 14px;
    padding: 10px;
  }
  .weekdays span {
    font-size: 10px;
  }
  .day-cell {
    min-height: 54px;
    border-radius: 9px;
  }
  .day-event-title {
    display: none;
  }
  .day-number {
    font-size: 15px;
  }
  .event-count {
    top: 5px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .log-row {
    display: grid;
  }
}
