* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(rgba(8, 22, 36, 0.36), rgba(8, 22, 36, 0.36)),
    url("bg-cockpit-sunset.jpg") center / cover fixed no-repeat;
  color: #123;
}
.topbar { display: flex; justify-content: space-between; align-items: center; background: #0e2a47; color: #fff; padding: 10px 16px; }
.topbar a { color: #c8e8ff; margin-left: 12px; text-decoration: none; }
.topbar-help-btn { margin-left: 12px; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-weight: 700; line-height: 32px; text-align: center; }
.user-pill { display: inline-block; margin-left: 12px; background: #1f6fb2; color: #fff; padding: 4px 10px; border-radius: 999px; font-size: .85rem; }
.brand { font-size: 1.2rem; font-weight: 700; letter-spacing: .5px; }
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.flash { background: #e7f6e7; color: #0a6010; padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.card { background: rgba(255, 255, 255, 0.92); border: 1px solid #cde; border-radius: 12px; padding: 14px; margin-bottom: 14px; box-shadow: 0 8px 18px rgba(20, 40, 80, 0.08); }
.profile-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid #c6ddf4; margin-bottom: 10px; }
label { display: block; margin-bottom: 10px; }
input, textarea, button { width: 100%; margin-top: 5px; padding: 9px; border-radius: 8px; border: 1px solid #aac; }
button, .btn { background: #1f6fb2; color: white; border: 0; cursor: pointer; display: inline-block; width: auto; padding: 9px 12px; border-radius: 8px; text-decoration: none; }
button:disabled, .btn:disabled { background: #b8c0cc; color: #6b7280; cursor: not-allowed; opacity: 1; }
.danger { background: #a32828; color: #fff; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.link { background: transparent; color: #a32828; padding: 0; }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; }
.week-nav-bottom { display: none; margin-top: 14px; }
.week-nav .btn { min-width: 130px; padding: 7px 10px; font-size: .9rem; text-align: center; }
.week-nav-actions { display: flex; gap: 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day { min-height: 260px; background: rgba(255,255,255,.9); border-radius: 10px; padding: 8px; border: 1px solid #c6ddf4; }
.flight-event { background: #cde7ff; border-left: 4px solid #2a7dc3; border-radius: 8px; padding: 8px; margin-bottom: 8px; font-size: .92rem; }
.flight-event.disabled { background: #d7d7d7; border-left-color: #888; opacity: .8; }
.flight-event.clickable:hover { box-shadow: 0 0 0 2px #99cfff inset; }
.event-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.event-actions a,
.event-actions .link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  width: auto;
  margin-top: 0;
}
.event-actions a {
  background: #1f6fb2;
  color: #fff;
}
.event-actions a:hover { background: #195d95; }
.event-actions .link {
  background: #fff;
  color: #a32828;
  border-color: #d89b9b;
}
.event-actions .link:hover { background: #fdeeee; }
.modal { position: fixed; inset: 0; background: rgba(6, 17, 29, .6); display: flex; align-items: center; justify-content: center; padding: 14px; }
.hidden { display: none; }
.modal-content { background: white; width: min(560px, 100%); border-radius: 12px; padding: 14px; }
.modal-content { position: relative; }
.modal-user-photo { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #c6ddf4; }
.row { display: flex; gap: 8px; justify-content: flex-end; }
.modal-preline { white-space: pre-line; line-height: 1.45; }
.manual-pre { white-space: pre-wrap; line-height: 1.4; max-height: 60vh; overflow-y: auto; background: #f6f8fb; padding: 10px; border-radius: 8px; border: 1px solid #dbe5f0; }
.footer-actions { display: flex; justify-content: center; margin: 14px 0 20px; }
.app-version { text-align: center; margin: 0 0 18px; font-size: .82rem; color: #606162; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.disclaimer-modal-content { max-height: 80vh; overflow-y: auto; }
.global-spinner { position: fixed; inset: 0; background: rgba(4, 14, 25, 0.45); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.global-spinner.hidden { display: none; }
.global-spinner-box { background: #fff; border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 10px; color: #123; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2); }
.global-spinner-wheel { width: 20px; height: 20px; border: 3px solid #c6ddf4; border-top-color: #2f7fc5; border-radius: 50%; animation: spin .8s linear infinite; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #d3dbe7; padding: 8px; text-align: left; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 980px) { .calendar-grid { grid-template-columns: repeat(2, 1fr); } .week-nav-bottom { display: flex; } }
@media (max-width: 600px) {
  .calendar-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .week-nav-actions { flex-direction: column; gap: 10px; }
}
