* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sukhumvit Set",
    "Helvetica Neue", Arial, sans-serif;
  background: #f4f6f9;
  color: #2c3e50;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

header h1 {
  font-size: 24px;
  color: #1e3a5f;
  margin-bottom: 20px;
  text-align: center;
}

.admin-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-box {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 280px;
}

.search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-success {
  background: #22c55e;
  color: #fff;
}
.btn-success:hover {
  background: #16a34a;
}

.btn-info {
  background: #0ea5e9;
  color: #fff;
}
.btn-info:hover {
  background: #0284c7;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}
.btn-primary:hover {
  background: #2563eb;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}
.btn-secondary:hover {
  background: #d1d5db;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.legend {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #6b7280;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.dot-expired {
  background: #fecaca;
  border: 1px solid #ef4444;
}

.dot-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
}

.dot-pending {
  background: #dbeafe;
  border: 1px solid #3b82f6;
}

.table-wrap {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #1e3a5f;
  color: #fff;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

th {
  font-weight: 600;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr.row-expired {
  background: #fee2e2;
}
tbody tr.row-expired:hover {
  background: #fecaca;
}

tbody tr.row-warning {
  background: #fef3c7;
}
tbody tr.row-warning:hover {
  background: #fde68a;
}

tbody tr.row-pending {
  background: #dbeafe;
}
tbody tr.row-pending:hover {
  background: #bfdbfe;
}

td.empty {
  text-align: center;
  color: #9ca3af;
  padding: 32px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-ok {
  background: #d1fae5;
  color: #065f46;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-expired {
  background: #fee2e2;
  color: #991b1b;
}

.status-pending {
  background: #dbeafe;
  color: #1e40af;
}

.action-cell {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

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

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #1e3a5f;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.required {
  color: #ef4444;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    min-width: 0;
  }
  .actions {
    justify-content: stretch;
  }
  .actions .btn {
    flex: 1;
  }
  th,
  td {
    padding: 8px;
    font-size: 13px;
  }
}
