/* Nota: todos los border-radius deben usar --radius-base (8px). */
:root {
  --radius-base: 8px;
}

html {
  background: #f3f4f8 url("../img/background.png") center/cover no-repeat fixed;
  min-height: 100%;
}

.screen-reader-svg {
  position: absolute;
}

body {
  font-family: "Inter", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: #1d3557;
}

body.sidebar-open {
  overflow: hidden;
}

body.login-page {
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
}

body.login-page main {
  flex: 1;
  min-height: calc(100vh - 2.5rem);
  padding: 1.25rem 0.75rem 1.75rem;
  align-items: flex-start;
}

.login-floating-logo {
  position: fixed;
  right: 1.25rem;
  bottom: 1rem;
  width: 200px;
  height: auto;
  opacity: 0.85;
  pointer-events: none;
  z-index: 50;
}

.login-floating-logo a {
  display: inline-block;
  pointer-events: auto;
}

.login-floating-logo img {
  width: 100%;
  height: auto;
  display: block;
}

body.login-page .main-shell {
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 640px;
  height: auto;
}

body.login-page .content-area {
  width: 100%;
  max-width: 560px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

body.login-page .auth-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.no-auth .side-menu {
  display: none;
}

.auth-header {
  /* background: rgba(17, 24, 39, 0.85); */
  background: rgb(39 46 63 / 95%);
  color: #f5f7fb;
  /* padding: 1.3rem 1rem; */ /* Comentado por logo en vez de titulo */
  display: flex;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.auth-header-inner {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.auth-brand img {
  height: 80px;
  width: auto;
  display: block;
}

.header-actions {
  position: absolute;
  right: 0;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.header-actions form {
  margin: 0;
}

.side-menu-mobile-actions {
  display: none;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-base);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #f1faee;
  font-size: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.header-icon-btn::before {
  font-size: 1.1rem;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.logout-btn::before {
  content: "⎋";
}

.settings-btn::before {
  content: "⚙";
}

.auth-menu-inline {
  display: none;
  gap: 0.75rem;
  position: absolute;
  right: 0;
}

.auth-menu-inline a {
  color: #f1faee;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-base);
  border: 1px solid transparent;
  font-weight: 600;
}

.auth-menu-inline a.active,
.auth-menu-inline a:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

main {
  flex: 1;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
}

.main-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.main-shell.no-sidebar {
  justify-content: center;
}

.no-auth .main-shell {
  justify-content: center;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.side-menu {
  width: clamp(220px, 26%, 260px);
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-base);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.14);
  padding: 1.6rem 1.2rem;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  backdrop-filter: blur(4px);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
}

.sidebar-toggle {
  display: none;
  align-self: flex-start;
  margin-bottom: 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-base);
  border: 1px solid rgba(29, 53, 87, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: #1d3557;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.18);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 180;
}

.sidebar-backdrop.active {
  display: block;
}

.menu-header {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  color: #1d3557;
}

.menu-list,
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  margin-bottom: 0.75rem;
}

.menu-link,
.submenu-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-base);
  color: #1d3557;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.version-floating {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: rgba(29, 53, 87, 0.85);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-base);
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.25);
  z-index: 999;
}

.menu-link:hover,
.submenu-link:hover {
  background: rgba(69, 123, 157, 0.12);
  transform: translateX(-2px);
}

.menu-accordion {
  margin-bottom: 1rem;
  border-radius: var(--radius-base);
  border: 1px solid rgba(69, 123, 157, 0.12);
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.menu-accordion summary {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  font-weight: 600;
  color: #1d3557;
  list-style: none;
}

.menu-accordion summary::marker,
.menu-accordion summary::-webkit-details-marker {
  display: none;
}

.menu-accordion summary:after {
  content: "▾";
  float: right;
  transition: transform 0.2s ease;
}

.menu-accordion[open] summary:after {
  transform: rotate(-180deg);
}

.submenu {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.8rem 0.8rem;
}

.flash-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-base);
  font-weight: 500;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.flash-messages.flash-inline {
  position: static;
  width: 100%;
  margin-top: 1rem;
  gap: 0.5rem;
}

.flash-success {
  background: rgba(212, 237, 218, 0.85);
  color: #155724;
}

.flash-danger {
  background: rgba(248, 215, 218, 0.85);
  color: #721c24;
}

.flash-warning {
  background: rgba(255, 243, 205, 0.85);
  color: #856404;
}

.flash-info {
  background: rgba(209, 236, 241, 0.85);
  color: #0c5460;
}

.flash-messages.flash-floating {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 92vw);
  z-index: 5;
  pointer-events: none;
}

.flash-messages.flash-floating .flash {
  pointer-events: auto;
  box-shadow: 0 15px 30px rgba(17, 24, 39, 0.18);
}

.token-result {
  margin-top: 1.5rem;
}

.auth-wrapper {
  min-height: calc(100vh - 6rem);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.25rem 0 2.25rem;
  width: 100%;
}

.no-sidebar .auth-wrapper,
.no-auth .auth-wrapper {
  padding: 1.75rem 1.25rem 2.5rem;
}

.auth-card {
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: var(--radius-base);
  padding: 2.4rem 2rem;
  box-shadow: 0 20px 44px rgba(17, 24, 39, 0.16);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.auth-card p {
  color: #4a4e69;
  margin-top: 0;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 1.75rem;
  text-align: center;
  font-size: 1.75rem;
  color: #1d3557;
}

.auth-secondary-action {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-secondary-action p {
  margin: 0 0 0.75rem;
  color: #4a4e69;
}

.auth-secondary-action .resend-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  color: #1d3557;
  font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-base);
  border: 1px solid rgba(69, 123, 157, 0.4);
  background-color: #ffffff;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #457b9d;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.25);
  outline: none;
}

button,
input[type="submit"] {
  background: #1d3557;
  color: #fff;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(29, 53, 87, 0.22);
}

.btn.secondary {
  background: transparent;
  color: #1d3557;
  border: 1px solid rgba(29, 53, 87, 0.4);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(29, 53, 87, 0.08);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: #1d3557;
  border: 1px solid rgba(29, 53, 87, 0.25);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(29, 53, 87, 0.08);
  box-shadow: none;
}

.btn.small {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

.actions-cell {
  width: 1%;
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

.submit-field {
  justify-content: flex-end;
}

.submit-field .full-width {
  width: 100%;
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-hero {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-base);
  padding: 1.6rem;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
}

.dashboard-hero h1 {
  margin: 0 0 0.75rem;
  color: #1d3557;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.registry-drone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-base);
  background: rgba(69, 123, 157, 0.12);
  color: #1d3557;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  width: fit-content;
}

.registry-drone-link img {
  width: 28px;
  height: 28px;
  display: block;
}

.registry-drone-link:hover {
  background: rgba(69, 123, 157, 0.22);
  transform: translateY(-1px);
}

.contact-link {
  color: #1d3557;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.onboarding-page .card-label a {
  color: inherit;
  text-decoration: none;
}

.onboarding-page .card-label a:hover {
  text-decoration: underline;
}

.panel-card.step-complete {
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

.step-status {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #065f46;
  font-weight: 600;
  font-size: 0.85rem;
}

.intro-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card,
.panel-card, .panel-card-changelog {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-base);
  padding: 1.35rem;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.11);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.card h3,
.panel-card h3 {
  margin: 0;
  color: #1d3557;
}

.card ul,
.panel-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card ul li,
.panel-card ul li {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-base);
  background: rgba(241, 250, 238, 0.8);
  color: #1d3557;
  font-size: 0.95rem;
}

.panel-card-changelog ul li {
  padding: 0rem 0rem;
  border-radius: var(--radius-base);
  background: rgba(241, 250, 238, 0.8);
  color: #1d3557;
  font-size: 0.95rem;
}

.card a,
.panel-card a {
  font-weight: 600;
  color: #1d3557;
  align-self: flex-start;
  text-decoration: none;
}

.card a:hover,
.panel-card a:hover {
  text-decoration: underline;
}

.card .button-link,
.panel-card .button-link {
  color: #fff;
}

.button-dash-logbook {
  width: 100%;
}

.card .button-link.outline,
.panel-card .button-link.outline {
  color: #1d3557;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-header h3 {
  margin: 0;
}

.card-header small {
  color: #4a4e69;
  display: block;
}

.pilot-card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pilot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pilot-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}

.scroll-list {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.operator-list li {
  gap: 0.2rem;
}

.operator-meta {
  color: #4a5568;
  font-size: 0.9rem;
  word-break: break-word;
  display: block;
}

.section-divider {
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  margin: 1.5rem 0;
}

.personnel-page {
  display: flex;
  justify-content: center;
}

.personnel-form {
  width: min(680px, 96vw);
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-base);
  padding: 2.25rem;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.16);
}

.settings-page {
  display: flex;
  justify-content: center;
}

.settings-card {
  width: min(640px, 95vw);
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-base);
  padding: 2.25rem;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.16);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subscription-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.status-messages p {
  margin: 0.25rem 0;
}

.status-pill .status-note {
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.3;
}
.status-pill .status-note.text-warning {
  color: #b45309;
}
.status-pill .status-note.text-info {
  color: #0ea5e9;
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: #1d3557;
}

.warning-card {
  border-left: 4px solid #d62828;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.form-grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.duration-field {
  border: 1px dashed rgba(29, 53, 87, 0.35);
  border-radius: var(--radius-base);
  padding: 0.75rem 1rem;
  background: rgba(29, 53, 87, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.duration-display {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.duration-value {
  font-size: 1.4rem;
  color: #1d3557;
}

.duration-value.warning {
  color: #d62828;
}

.duration-hint {
  font-size: 0.85rem;
  color: #4b5563;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.detail-grid .detail-span {
  grid-column: span 2;
}

.detail-item {
  background: rgba(29, 53, 87, 0.035);
  border-radius: var(--radius-base);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.detail-item strong {
  font-size: 1rem;
  color: #111827;
  word-break: break-word;
}

.detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-summary > div {
  flex: 1 1 220px;
  background: rgba(29, 53, 87, 0.06);
  border-radius: var(--radius-base);
  padding: 0.85rem 1rem;
}

.detail-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.detail-section {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(17, 24, 39, 0.05);
  border-radius: var(--radius-base);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
}

.detail-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #1d3557;
  font-size: 1.05rem;
}

.detail-role-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-role-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(29, 53, 87, 0.04);
  border-radius: var(--radius-base);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #0f2741;
}

.detail-role-list span {
  color: #4b5563;
  font-weight: 500;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.2);
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.08);
}

.detail-notes {
  background: rgba(29, 53, 87, 0.05);
  border-radius: var(--radius-base);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.detail-notes p {
  margin: 0.25rem 0 0;
  color: #1f2937;
  white-space: pre-line;
}

.settings-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: #1d3557;
  font-weight: 600;
  text-decoration: none;
}

.settings-link:hover {
  text-decoration: underline;
}

.pilot-profile-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.pilot-profile-main {
  width: 100%;
}

.pilot-profile-page {
  flex-direction: column;
  gap: 1.25rem;
}

.pilot-profile-page .pilot-selector {
  width: min(840px, 96vw);
  align-self: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-base);
  padding: 1.5rem;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.14);
}

.pilot-license-link {
  margin-top: 0.75rem;
}

.pilot-license-link img {
  width: 24px;
  height: 24px;
}

.pilot-profile-card,
.pilot-license-card,
.pilot-status-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-base);
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.pilot-profile-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pilot-selector .selector-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.pilot-selector .field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pilot-selector .selector-action {
  display: flex;
  align-items: center;
}

.pilot-selector .selector-action button {
  margin: 0;
}

.settings-card h1 {
  margin: 0;
  color: #1d3557;
}

.settings-card p {
  margin: 0;
  color: #4a5665;
}

.personnel-form h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.table-card {
  background: #ffffff;
  border-radius: var(--radius-base);
  padding: 1.6rem;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.12);
  overflow-x: auto;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-card th,
.table-card td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(69, 123, 157, 0.18);
}

.table-card th {
  color: #1d3557;
  font-weight: 700;
  background: rgba(69, 123, 157, 0.08);
}

.validator-reject-form {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.validator-reject-input {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-base);
  border: 1px solid rgba(69, 123, 157, 0.35);
}

.documentation-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.documentation-header h1 {
  margin: 0 0 0.35rem;
  color: #1d3557;
}

.documentation-header p {
  margin: 0;
  color: #4a5665;
}

.back-link {
  color: #1d3557;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.doc-card .doc-meta {
  font-size: 0.9rem;
  color: #4a5665;
}

.doc-card .doc-meta.pending {
  color: #d62828;
}
.doc-card {
  position: relative;
  overflow: hidden;
}

.doc-critical-card {
  position: relative;
}

.doc-status-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  animation: doc-pulse 2s ease-in-out infinite;
}

.doc-status-ok {
  background: #2a9d8f;
  box-shadow: 0 0 12px rgba(42, 157, 143, 0.65);
}

.doc-status-missing {
  background: #d62828;
  box-shadow: 0 0 12px rgba(214, 40, 40, 0.65);
}

.doc-status-warning {
  background: #f4a261;
  box-shadow: 0 0 12px rgba(244, 162, 97, 0.65);
}

.doc-critical-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.doc-critical-heading .doc-status-indicator {
  position: static;
  width: 18px;
  height: 18px;
}

@keyframes doc-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.85;
  }
}

.doc-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.doc-upload-popover {
  position: absolute;
  inset: 0.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-base);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  z-index: 3;
  backdrop-filter: blur(2px);
}

.doc-upload-popover.is-visible {
  display: flex;
}

.doc-upload-popover-inner {
  background: #ffffff;
  border-radius: var(--radius-base);
  padding: 1rem;
  width: min(320px, 90%);
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.2);
}

.doc-upload-popover-inner header {
  margin-bottom: 0.75rem;
}

.doc-upload-popover-inner h4 {
  margin: 0 0 0.25rem;
}

.doc-upload-popover .field {
  margin-bottom: 0.75rem;
}

.doc-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.doc-upload-popover[aria-hidden="true"] {
  pointer-events: none;
}

.doc-download-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-download-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-base);
  background: rgba(241, 250, 238, 0.75);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.doc-entry {
  display: flex;
  flex-direction: column;
  max-width: min(70vw, 360px);
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
}

.doc-entry small {
  color: #4a4e69;
}
.doc-download-list strong {
  display: block;
  color: #1d3557;
}

.doc-download-list small {
  display: block;
  color: #4a5665;
}

.doc-download-list small.pending {
  color: #d62828;
}

.logbook-metrics-card .card-header {
  align-items: center;
  margin-bottom: 1rem;
}

.logbook-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(69, 123, 157, 0.15);
  color: #1d3557;
  font-weight: 600;
}

.logbook-metrics {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: nowrap;
}

.logbook-metric {
  flex: 1 1 140px;
  background: rgba(29, 53, 87, 0.05);
  border-radius: var(--radius-base);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
}

.logbook-metric strong {
  font-size: 1.6rem;
  color: #111827;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 1rem;
  border-radius: var(--radius-base);
  background: #1d3557;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.button-link:hover {
  background: #0f2741;
}

.button-link.button-link-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.button-link.secondary {
  background: #0f2741;
}

.button-link.secondary:hover {
  background: #2b5c7e;
}

.button-link.outline {
  background: transparent;
  border: 1px solid #1d3557;
  color: #1d3557;
}

.button-link.outline:hover {
  background: rgba(29, 53, 87, 0.08);
}

.upload-section,
.upload-history {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-base);
  padding: 1.5rem;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

.logbook-actions {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(240px, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .logbook-actions {
    grid-template-columns: 1fr;
  }
}

.export-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.export-card .button-link {
  justify-content: center;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-weight: 600;
  color: #1d3557;
}

.form-input {
  padding: 0.75rem;
  border-radius: var(--radius-base);
  border: 1px solid rgba(69, 123, 157, 0.35);
  background: rgba(241, 250, 238, 0.6);
  cursor: pointer;
}

.form-error {
  color: #d62828;
  font-size: 0.85rem;
}

.upload-history h2 {
  margin-top: 0;
  color: #1d3557;
}

.upload-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-base);
  background: rgba(241, 250, 238, 0.9);
  color: #1d3557;
  font-size: 0.95rem;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.upload-list li > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.upload-list strong {
  display: block;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.upload-list small {
  color: #4a5665;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.upload-actions span {
  color: #1d3557;
  font-weight: 600;
}

@media (max-width: 960px) {
  main {
    padding: 2rem 1rem;
  }

  .main-shell {
    flex-direction: column-reverse;
    gap: 2rem;
  }

  .header-actions {
    display: none;
    /* position: static; */
  }

  .side-menu {
    width: min(80vw, 320px);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: var(--radius-base);
    padding-top: 1rem;
    z-index: 200;
    overflow-y: auto;
  }

  .side-menu.is-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    position: fixed;
    right: 0.75rem;
    top: 0.9rem;
    z-index: 220;
    margin: 0;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-base);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.24);
    backdrop-filter: blur(6px);
  }

  .auth-card {
    padding: 2.25rem 1.75rem;
  }

  .personnel-form {
    padding: 1.85rem;
  }

  .side-menu-mobile-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
  }

  .side-menu-mobile-actions .header-icon-btn {
    border-color: rgba(17, 24, 39, 0.12);
    background: rgba(17, 24, 39, 0.08);
    color: #1d3557;
  }

  .side-menu-mobile-actions .header-icon-btn:hover {
    background: rgba(17, 24, 39, 0.16);
    transform: translateY(-1px);
  }
}

@media (max-width: 640px) {
  .pilot-selector .selector-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1em;
  }


  .sidebar-toggle {
    top: 0.5rem;
    padding: 0.5rem 0.7rem;
  }

  .side-menu {
    padding-top: 1rem;
  }

  .side-menu-mobile-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
  }

  .pilot-selector .field {
    flex-direction: column;
    align-items: flex-start;
  }

  .pilot-selector .selector-action {
    width: 100%;
  }

  .pilot-selector .selector-action button {
    width: 100%;
    margin-top: 0.5rem;
  }

  .pilot-profile-page .pilot-selector {
    padding: 0rem;
    max-width: 100%;
  }

  main {
    padding: 1.75rem 0.75rem 2.25rem;
  }

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

  .operator-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-card {
    padding: 1.25rem;
  }
  
  .auth-header {
    /* position: sticky;
    top: 0;
    z-index: 300; */
    padding: 0rem 0.75rem;
  }

  .auth-header-inner {
    max-width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .auth-brand img {
  height: 45px;
  }

  /* .menu-header {
    margin-top: 1.35rem;
  } */

  .header-actions {
    display: none;
    /* position: static; */
  }

  .header-icon-btn {
  width: 40px;
  height: 40px;
  }

  .login-floating-logo {
  max-width: 150px;
  }
  .registry-drone-link {
    /* width: 100%; */
    justify-content: center;
    font-size: 1rem;
    gap: 0.6rem;
  }

  .registry-drone-link img {
    width: 32px;
    height: 32px;
  }

  .operator-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-wrapper {
    padding: 1.5rem 0.75rem;
  }

  .auth-card {
    width: 100%;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-base);
  }

  .content-area .dashboard-page .dashboard-hero h1 {
    font-size: 1.60em;
  }

  .auth-card h1 {
    font-size: 1.45rem;
  }

  .field input,
  .field select {
    padding: 0.65rem 0.75rem;
  }

  .auth-wrapper {
    padding: 1.5rem 0.75rem;
    max-width: 100%;
  }

  .no-sidebar .auth-wrapper,
  .no-auth .auth-wrapper {
    padding: 1.5rem 0.75rem;
  }
  
  .content-area {
    max-width: 100%;
  }

  .upload-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .upload-actions .button-link {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .detail-sections .detail-grid{
    display: block;
  }

  .detail-sections .detail-grid .detail-item, 
  .detail-item detail-span {
    margin: 5px;
  }

  .doc-download-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .doc-download-list li .button-link {
    align-self: flex-start;
  }
  .menu-version {
    margin-top: 2rem;
    text-align: left;
  }

  .menu-version a {
  text-decoration: none;
  }

  .panel-dash-operator {
    display: none;
  }

  .doc-upload-popover {
    background: rgba(0, 0, 0, 0.0);
    justify-content: left;
    padding: 0.75rem;
  }
  .doc-upload-popover.is-visible {
    display: flex;
  }

  .doc-upload-popover-inner {
    width: min(320px, 90%);
  }
  .doc-upload-actions {
    justify-content: left;
  }
}

@media (min-width: 768px) {
  .auth-mobile-menu {
    display: none;
  }

  .auth-menu-inline {
    display: none;
  }
}
.pilot-license-history {
  width: 100%;
}

.license-history-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-base);
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
  max-height: 320px;
  overflow-y: auto;
}
.menu-version {
  margin-top: auto;
  padding: 0.75rem;
  text-align: left;
  color: #6b7280;
  font-weight: 600;
}

.menu-version a {
  text-decoration: none;
  color: #6b7280;
}

.menu-logo {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
}

.menu-logo img {
  width: 160px;
  height: auto;
  opacity: 0.85;
}

.changelog {
  /* background: rgba(17, 24, 39, 0.04); */
  padding: 1.25rem;
  border-radius: var(--radius-base);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  max-height: 32rem;
  overflow-y: auto;
}

.changelog h2,
.changelog h3,
.changelog h4 {
  margin-top: 1.25rem;
  color: #1d3557;
}

.changelog ul {
  /* margin-left: 1.25rem; */
  list-style: disc;
}

.changelog ul li{
  background: #ffffff;
}
