@font-face {
  font-family: "Roboto";
  src: url("../../css/fonts/roboto/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Roboto";
  src: url("../../css/fonts/roboto/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg: #111816;
  --surface: #1a2421;
  --surface-soft: #24302c;
  --surface-strong: #202b27;
  --text: #eef4f1;
  --muted: #9cacaa;
  --line: #34433e;
  --accent: #35b89f;
  --accent-dark: #24967f;
  --gold: #d6a63b;
  --warning: #f0b35e;
  --danger: #ff746e;
  --danger-soft: #3a2423;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 18px;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.05rem;
}

.icon-link,
.icon-button,
.ghost-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.icon-link:hover,
.icon-button:hover,
.ghost-button:hover {
  background: var(--accent);
  color: #08100e;
  transform: translateY(-1px);
}

.app-shell,
.full-shell {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 36px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-panel h1 {
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-error {
  border-left: 3px solid rgba(255, 116, 110, 0.6);
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--text);
  margin-bottom: 14px;
  padding: 10px 12px;
}

.full-shell {
  grid-template-columns: 1fr;
}

.editor-panel,
.list-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-panel {
  align-self: start;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
}

.list-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.count-pill {
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.full-controls {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 16px;
}

.large-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}

.large-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-visual {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 34px;
  border-radius: 999px;
  background: #4b5b55;
  transition: background 0.16s ease;
}

.toggle-visual::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 2px 6px rgba(23, 33, 31, 0.2);
  content: "";
  transition: transform 0.16s ease;
}

.large-toggle input:checked + .toggle-visual {
  background: var(--accent);
}

.large-toggle input:checked + .toggle-visual::after {
  transform: translateX(28px);
}

.toggle-text {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label span,
legend {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 184, 159, 0.18);
}

.members-fieldset {
  margin: 16px 0 12px;
  padding: 0;
  border: 0;
}

.member-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.member-chip input,
.check-line input {
  width: auto;
  min-height: auto;
}

.member-chip span {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  text-transform: none;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.check-line span {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 400;
  text-transform: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #08100e;
  padding: 0 16px;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.event-item.is-optional {
  border-color: #3a4642;
  border-left-color: #707e79;
  background: #1e2724;
  color: #889792;
  opacity: 0.76;
}

.event-item.is-optional::after {
  position: absolute;
  top: 50%;
  left: -8%;
  width: 116%;
  height: 2px;
  background: rgba(210, 221, 217, 0.24);
  content: "";
  pointer-events: none;
  transform: rotate(-2deg);
}

.event-item.is-optional .event-main,
.event-item.is-optional .event-date,
.event-item.is-optional .event-actions {
  position: relative;
  z-index: 1;
}

.event-item.has-warning {
  border-top-color: rgba(240, 179, 94, 0.72);
  border-right-color: rgba(240, 179, 94, 0.72);
  border-bottom-color: rgba(240, 179, 94, 0.72);
}

.event-date {
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 8px;
  background: var(--surface-soft);
}

.event-date strong {
  font-size: 1.55rem;
  line-height: 1;
}

.event-date span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-main {
  min-width: 0;
}

.event-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.event-topline h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.time-pill {
  border-radius: 8px;
  background: rgba(53, 184, 159, 0.16);
  color: #8ee8d6;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.optional-pill {
  border-radius: 8px;
  background: #34403c;
  color: #becac6;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow-wrap: anywhere;
}

.event-people {
  margin-top: 8px;
  color: var(--text);
  font-size: 0.92rem;
}

.event-warning-lines {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  color: #c2ceca;
  font-size: 0.85rem;
  font-weight: 500;
}

.event-warning-lines > span {
  display: block;
  border-left: 3px solid rgba(255, 116, 110, 0.42);
  border-radius: 6px;
  background: var(--danger-soft);
  padding: 6px 8px;
  overflow-wrap: anywhere;
}

.alert-highlight {
  color: var(--danger);
  font-weight: 700;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px 14px;
  text-align: center;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.app-toast {
  border-radius: 8px;
  background: #26332f;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-success {
  background: var(--accent);
}

.app-toast.is-danger {
  background: var(--danger);
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .editor-panel,
  .list-panel {
    box-shadow: none;
  }

  .editor-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .app-header {
    padding-top: 18px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .app-shell,
  .full-shell {
    padding-inline: 10px;
  }

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

  .event-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .event-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .event-topline {
    display: grid;
    gap: 8px;
  }

  .full-controls,
  .large-toggle {
    width: 100%;
  }

  .large-toggle {
    justify-content: space-between;
  }

  .time-pill {
    width: max-content;
  }

  .event-badges {
    justify-content: flex-start;
  }
}
