html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #2454a6;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin-bottom: 60px;
  background: #f5f7fb;
  color: #172033;
}

.app-navbar {
  background: #ffffff;
  border-bottom: 1px solid #d9e0ea;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0;
}

.download-shell {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.download-panel,
.admin-panel {
  background: #ffffff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.download-panel {
  width: min(100%, 460px);
  padding: 28px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 1.15rem;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1c7c54;
  box-shadow: 0 0 0 4px rgba(28, 124, 84, 0.14);
  flex: 0 0 auto;
}

.status-dot.muted {
  background: #536176;
  box-shadow: 0 0 0 4px rgba(83, 97, 118, 0.14);
}

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

.key-input,
.key-output {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-error {
  min-height: 20px;
  display: block;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  padding: 28px 0;
  align-items: start;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-panel {
  padding: 22px;
}

.secondary-panel {
  box-shadow: none;
}

.upload-form {
  display: grid;
  gap: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.generated-key {
  border: 1px solid #b7d8c7;
  background: #eef8f3;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}

.generated-label {
  color: #315f49;
  font-weight: 700;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.file-table {
  margin-bottom: 0;
}

.file-table th {
  color: #536176;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.file-table td {
  white-space: nowrap;
}

.file-name {
  max-width: 360px;
  overflow-wrap: anywhere;
  white-space: normal !important;
  font-weight: 600;
}

.file-path {
  margin-top: 4px;
  color: #536176;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.registered-list {
  display: grid;
  gap: 14px;
}

.registered-item {
  display: grid;
  gap: 12px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

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

.registered-key-row {
  display: grid;
  gap: 6px;
}

.registered-key-row .form-label {
  margin-bottom: 0;
  color: #536176;
  font-size: 0.85rem;
  font-weight: 700;
}

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

.registered-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #d9e0ea;
  border-radius: 999px;
  padding: 2px 9px;
  background: #ffffff;
  color: #536176;
  font-size: 0.82rem;
  white-space: nowrap;
}

.missing-key {
  border: 1px dashed #c7cedb;
  border-radius: 8px;
  padding: 9px 10px;
  color: #7a3545;
  background: #fff7f8;
  font-size: 0.9rem;
}

.empty-state {
  border: 1px dashed #b8c2d2;
  border-radius: 8px;
  color: #536176;
  padding: 22px;
  text-align: center;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  border-top: 1px solid #d9e0ea;
  background: #ffffff;
}

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

@media (max-width: 576px) {
  .download-panel,
  .admin-panel {
    padding: 18px;
  }

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