@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg-deep: #072f3a;
  --bg-mid: #0b5363;
  --bg-soft: #0f6674;
  --nav-bg: #e7ecef;
  --nav-ink: #16323a;
  --panel: rgba(5, 60, 71, 0.82);
  --panel-strong: rgba(4, 51, 61, 0.9);
  --ink: #edf6f7;
  --ink-soft: #d5e6e9;
  --muted: #a7c0c6;
  --accent: #d4a34b;
  --accent-strong: #e4b867;
  --line: rgba(160, 201, 210, 0.25);
  --line-strong: rgba(160, 201, 210, 0.44);
  --ok: #79bcc6;
  --warn: #d4a34b;
  --error: #efbb9f;
  --shadow: 0 18px 44px rgba(2, 19, 23, 0.38);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 78% 26%, rgba(115, 225, 240, 0.22), transparent 34%),
    linear-gradient(124deg, var(--bg-deep) 10%, var(--bg-mid) 56%, var(--bg-soft) 100%);
}

body::before {
  content: "";
  position: fixed;
  top: 78px;
  right: -120px;
  width: min(44vw, 540px);
  height: min(74vh, 800px);
  border-radius: 50% 50% 46% 54% / 42% 50% 50% 58%;
  background: radial-gradient(circle at 52% 28%, rgba(126, 233, 245, 0.45), rgba(60, 182, 198, 0.12) 45%, transparent 72%);
  border: 1px solid rgba(152, 225, 236, 0.26);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 24, 29, 0.04), rgba(4, 24, 29, 0.2));
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(106, 138, 146, 0.32);
  background: var(--nav-bg);
  color: var(--nav-ink);
  box-shadow: 0 10px 24px rgba(13, 38, 44, 0.18);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: #4a6b74;
  font-weight: 600;
}

h1 {
  margin: 0 0 4px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 0;
  max-width: 760px;
  color: #597880;
  font-size: 14px;
}

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

.card {
  background: linear-gradient(170deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(5px);
}

.form-card,
.team-card {
  grid-column: span 4;
}

.agenda-card,
.week-card {
  grid-column: span 8;
}

.is-hidden {
  display: none !important;
}

.card-header h2 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 0.95;
  font-weight: 700;
  color: #f4f9fa;
}

.card-header p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

input,
select,
button {
  font-family: inherit;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 42, 50, 0.62);
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(212, 163, 75, 0.25);
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--accent);
  color: #2d240f;
  box-shadow: 0 10px 18px rgba(134, 94, 28, 0.25);
}

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

.secondary {
  background: rgba(13, 84, 98, 0.92);
  color: #e1f0f3;
  border: 1px solid rgba(152, 214, 224, 0.32);
}

.secondary:hover {
  background: rgba(17, 95, 110, 0.95);
}

.ghost {
  background: rgba(7, 56, 66, 0.5);
  border: 1px dashed rgba(161, 198, 207, 0.5);
  color: #cadae0;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.form-agenda-controls {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.switch input {
  width: 16px;
  height: 16px;
  margin: 0;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(164, 201, 210, 0.36);
  background: rgba(4, 49, 58, 0.72);
  color: #d7e8eb;
  font-size: 12px;
}

.chip button {
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 0 6px;
  font-size: 12px;
}

.chips-empty {
  color: var(--muted);
  font-size: 13px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.participants {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participant {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 50, 60, 0.72);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-name {
  font-weight: 700;
  font-size: 14px;
  color: #e5f1f3;
}

.agenda-controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 220px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.month-field span {
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.ok {
  background: var(--ok);
}

.legend-dot.warn {
  background: var(--warn);
}

.legend-dot.error {
  background: var(--error);
}

.month-calendar {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(3, 40, 48, 0.66);
}

.mini-calendar {
  max-height: 360px;
  overflow: auto;
}

.mini-calendar .calendar-weekdays {
  position: sticky;
  top: 0;
  z-index: 2;
}

.mini-calendar .weekday {
  padding: 8px 6px;
  font-size: 11px;
}

.mini-calendar .day-cell {
  min-height: 62px;
  padding: 6px;
  gap: 4px;
}

.mini-calendar .day-date {
  font-size: 12px;
}

.mini-calendar .day-head {
  justify-content: flex-start;
}

.mini-week-toggle {
  margin-top: auto;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  align-self: flex-start;
  background: rgba(212, 163, 75, 0.22);
  border: 1px solid rgba(212, 163, 75, 0.5);
  color: #f2dbac;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(9, 61, 72, 0.96);
}

.weekday {
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #cfe4e8;
}

.weekday.is-weekend {
  background: rgba(167, 184, 191, 0.18);
  color: #d6e1e5;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-cell {
  min-height: 108px;
  border-right: 1px solid rgba(140, 182, 191, 0.2);
  border-bottom: 1px solid rgba(140, 182, 191, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: rgba(5, 58, 68, 0.44);
  color: #dce9ec;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.day-cell:nth-child(7n) {
  border-right: none;
}

.day-cell:hover {
  background: rgba(14, 86, 99, 0.52);
}

.day-cell.is-out-month {
  background: rgba(5, 46, 55, 0.38);
  color: #90abb2;
}

.day-cell.is-weekend {
  background: rgba(106, 125, 133, 0.2);
}

.day-cell.is-out-month.is-weekend {
  background: rgba(102, 120, 127, 0.16);
}

.day-cell.is-selected-week {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: rgba(13, 79, 92, 0.58);
}

.day-cell.is-selected-week.is-weekend {
  background: rgba(112, 129, 136, 0.26);
}

.day-cell.is-today {
  box-shadow: inset 0 0 0 2px #96d6e0;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.day-date {
  font-size: 13px;
  font-weight: 700;
}

.day-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ok);
}

.day-status-dot.status-ok {
  background: var(--ok);
}

.day-status-dot.status-warn {
  background: var(--warn);
}

.day-status-dot.status-error {
  background: var(--error);
}

.week-badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(212, 163, 75, 0.22);
  border: 1px solid rgba(212, 163, 75, 0.46);
  color: #f0d8a7;
}

.week-global {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: #c4d9de;
}

.day-oncall {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.35;
  color: #f1f6f7;
  background: rgba(8, 70, 82, 0.76);
  border: 1px solid rgba(128, 182, 192, 0.34);
  border-radius: 8px;
  padding: 4px 6px;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 53, 62, 0.76);
  padding: 14px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-title {
  font-weight: 700;
}

.week-global-row {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.week-global-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(4, 46, 55, 0.72);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.week-global-item span {
  font-size: 11px;
  color: var(--muted);
}

.week-global-item strong {
  font-size: 15px;
  color: #f0f7f8;
}

.summary-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.list-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-title {
  font-size: 12px;
  color: var(--muted);
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.ok {
  background: rgba(121, 188, 198, 0.26);
  color: #d9eff2;
}

.badge.warn {
  background: rgba(212, 163, 75, 0.28);
  color: #ffe8bf;
}

.badge.error {
  background: rgba(239, 187, 159, 0.26);
  color: #ffe3d2;
}

.warning-text {
  font-size: 12px;
  color: #dfbb74;
}

@media (max-width: 1080px) {
  .form-card,
  .team-card,
  .agenda-card,
  .week-card {
    grid-column: span 12;
  }

  .agenda-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body::before {
    display: none;
  }

  .hero {
    align-items: flex-start;
  }

  .calendar-weekdays {
    display: none;
  }

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

  .day-cell {
    min-height: 96px;
    border-right: none;
  }
}
