:root {
  --bg: #0a0c10;
  --panel: #121721;
  --panel-2: #171d29;
  --line: #263041;
  --text: #e8edf5;
  --muted: #96a2b5;
  --gold: #fdbe2c;
  --gold-dark: #d89d14;
  --red: #da4f4f;
  --green: #2eb67d;
  --blue: #4da3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  height: 100%;
}

body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #111722, #0e141d);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--gold);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  padding: 14px;
  flex: 1;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.small-text {
  font-size: 13px;
  color: var(--muted);
}

.tip-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.tip-list li {
  margin-bottom: 8px;
}

.calendar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  min-height: 700px;
}

#calendar {
  width: 100%;
  height: 100%;
}

.footerbar {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  color: var(--muted);
  background: #0d121a;
}

.btn,
select,
input,
textarea {
  font: inherit;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--gold);
  color: #111;
}

.btn-primary:hover {
  background: var(--gold-dark);
}

.btn-secondary {
  background: #202838;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.status-pill {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  background: rgba(46, 182, 125, 0.14);
  color: #76e0af;
  border: 1px solid rgba(46, 182, 125, 0.35);
}

.status-pill.warn {
  background: rgba(253, 190, 44, 0.14);
  color: #ffd46d;
  border: 1px solid rgba(253, 190, 44, 0.35);
}

.status-pill.error {
  background: rgba(218, 79, 79, 0.14);
  color: #ff8f8f;
  border: 1px solid rgba(218, 79, 79, 0.35);
}

.status-pill.neutral {
  background: rgba(77, 163, 255, 0.14);
  color: #8fc1ff;
  border: 1px solid rgba(77, 163, 255, 0.35);
}

.validation-list {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.validation-item {
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #111722;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid label span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
}

.full {
  grid-column: 1 / -1;
}

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.context-menu {
  position: fixed;
  background: #121721;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  z-index: 1100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.context-menu.hidden {
  display: none;
}

.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.context-menu button:hover {
  background: #1d2432;
}

.fc {
  --fc-border-color: #243042;
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: #111722;
  --fc-list-event-hover-bg-color: #1c2432;
  --fc-today-bg-color: rgba(253, 190, 44, 0.08);
  color: var(--text);
}

.fc .fc-toolbar-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.fc .fc-button {
  background: #1d2432;
  border: 1px solid #2d384b;
  color: var(--text);
  box-shadow: none;
}

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #111;
}

.fc-event {
  border-radius: 10px !important;
  padding: 2px 4px;
  font-weight: 700;
  font-size: 12px;
}

@media (max-width: 980px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

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