* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f4f4;
  color: #222;
}

a {
  color: #1a5fb4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 20px;
  margin-bottom: 20px;
}

.header {
  background: #222;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: normal;
}

.header .user {
  font-size: 14px;
}

.nav {
  margin-top: 8px;
}

.nav button {
  margin-right: 8px;
}

.login-wrap {
  max-width: 400px;
  margin: 80px auto;
}

h2 {
  margin-top: 0;
  font-size: 20px;
}

label {
  display: block;
  margin: 12px 0 4px;
  font-size: 14px;
}

input[type="email"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

button,
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

button:hover,
.btn:hover {
  background: #555;
}

button.secondary {
  background: #fff;
  color: #333;
}

button.secondary:hover {
  background: #eee;
}

button.active {
  background: #1a5fb4;
  border-color: #1a5fb4;
}

.msg {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
  display: none;
}

.msg.error {
  display: block;
  background: #ffe8e8;
  border-color: #cc0000;
  color: #800;
}

.msg.success {
  display: block;
  background: #e8ffe8;
  border-color: #2a7a2a;
  color: #1a5a1a;
}

.msg.info {
  display: block;
  background: #eef5ff;
  border-color: #1a5fb4;
  color: #123;
}

.hidden {
  display: none !important;
}

.section-title {
  margin-bottom: 12px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.row .field {
  flex: 1;
  min-width: 180px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

th,
td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  background: #eee;
}

.table-wrap {
  overflow-x: auto;
}

.count {
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}

.tabs {
  margin-bottom: 12px;
}

.tabs button {
  margin-right: 6px;
  margin-bottom: 6px;
}

.csv-format {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ddd;
}

.csv-format-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.csv-format th {
  white-space: nowrap;
}

button.danger {
  background: #a40000;
  border-color: #a40000;
  color: #fff;
}

button.danger:hover {
  background: #cc0000;
}

button:disabled,
button.danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  cursor: pointer;
}

.radio-option input {
  width: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  background: #fff;
  border: 1px solid #ddd;
  padding: 20px;
  max-width: 440px;
  width: 100%;
  z-index: 1;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.modal-card p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input {
  width: auto;
}

.created-key-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #2a7a2a;
  background: #e8ffe8;
  font-size: 13px;
}

.created-key-box code {
  display: block;
  margin: 8px 0;
  word-break: break-all;
  font-size: 12px;
}
